草庐IT

Get-Date

全部标签

windows - 赢bat文件: How to get the result of FIND into a new variable?

pdftk工具“dump_data”功能可用于传递有关pdf的元信息,包括页数。以下命令...pdftktest.pdfdump_data|find"NumberOfPages"...输出完整的数据转储行,例如:"Numberofpages:32"如何将计数值(在上述情况下为32)放入新变量中以便在bat文件中进一步处理? 最佳答案 如果该行的格式是固定的并且与您显示的格式相匹配,您可以尝试这样的操作:@ECHOOFF>testfileECHONumberofpages:32FOR/F"delims=:tokens=2"%%AIN(

c - gtk_entry_get_text 不工作

我在c中使用GTK2.2。我可以从其中一个条目中获取文本并使用类型转换将其转换为整数,但它不适用于第二个条目。由于某种原因,我设置为从第二个条目获取文本的变量保持为0。这是我的代码。button2_clicked部分不工作,但问题也可能出在button2g_signal连接上。#include#includeintprod,prod_amt,amt,amt_holder,tot_amt;staticvoidbutton3_clicked(GtkWidget*widget,gpointerwindow){GtkWidget*dialog;dialog=gtk_message_dialog

windows - Powershell get-service 通过管道传输到停止进程

Get-Service|Stop-Process-NameWSearch-WhatIfStop-Process:Theinputobjectcannotbeboundtoanyparametersforthecommandeitherbecausethecommanddoesnottakepipelineinputortheinputanditspropertiesdonotmatchanyoftheparametersthattakepipelineinput.Atline:1char:15+Get-Service|Stop-Process-NameWSearch-WhatIf+~~

windows - PowerShell boolean 表达式

我正在编写一个powershell脚本,但在评估boolean表达式时遇到问题。这是我遇到问题的代码行:if(Get-Content.\Process2Periods.xmla|Select-String((Get-Date)|Get-Date-Format"yyyyMM")-quiet-neTrue)我在尝试运行时收到此错误消息:Select-String:Aparametercannotbefoundthatmatchesparametername'ne'.请帮助我理解这个问题。还有一点上下文,我正在文件中搜索一个字符串,如果它不存在,我想执行ifblock中的内容。我没有将代码粘

windows - powershell:get-psdrive 和 where-object

我试图在Windows2008服务器上查找不是“C、E、L、S、T、W”的每个驱动器号。谁能告诉我我逻辑上的错误或我该怎么做?[char[]]”CELSTW”|Where-Object{!(Get-PSDrive$_)} 最佳答案 您从不需要的驱动器号列表(CELSTW)开始,并将不存在的驱动器号输出为psdrive。您想要的是从所有PSDrive的列表开始,然后在与您不想要的相匹配的地方过滤掉它们:Get-PSDrive|Where-Object{[char[]]"CELSTW"-notcontains$_.Name}虽然这会给你

ruby-on-rails - 为什么错误 "No route matches [GET] "/users/sign_out”?

当我登录到我的应用程序时,它显示我已成功登录。但是当我点击导航栏中的链接退出时,它给我一个路由错误。我不确定为什么我总是收到路由错误。我基本上已经尝试了关于此错误的所有答案,但我似乎无法弄清楚。RoutingErrorNoroutematches[GET]"/users/sign_out"Rails.root:c:/Users/Doesha/desktop/pinplugApplicationTrace|FrameworkTrace|FullTraceRoutesRoutesmatchinpriorityfromtoptobottomHelperHTTPVerbPathControll

windows - 如何只打印 Get-ExecutionPolicy 中的 Scope 和 Policy 项?

这对于Windows大师来说应该是微不足道的,但对于*nix历史学家来说似乎相当令人生畏。我想仅打印表中的Scope和ExecutionPolicy值,通过以下方式获得:#Actualoutput:(Get-ExecutionPolicy-List)ScopeExecutionPolicy--------------------MachinePolicyUndefinedUserPolicyUndefinedProcessUndefinedCurrentUserUndefinedLocalMachineBypass#Expectedoutput:MachinePolicyUndefin

java - 从 Java date.getHour() 获取 Linux 和 Windows 的时差

我有一些解析字符串并创建日期对象的Java代码。在Linux上,一切正常,但在Windows上,它连续从19:00:00开始,而不是00:00:00。这是代码:if(currTask!=null){if((m=p0.matcher(currTask)).matches()){date=newDate(Long.valueOf(m.group(2))-Long.valueOf(m.group(1)));}elseif((m=p.matcher(currTask)).matches()){date=newDate(System.currentTimeMillis()-Long.valueO

C++ Windows MFC 并发 : Get thread to wait until particular state achieved

在WindowsMFC并发上,我如何告诉我的当前线程等待直到达到特定状态?目前我能想到的唯一方法是执行周期性sleep并检查状态——当我们处于预期状态时,然后继续。有更好的方法吗?BOOLachieved=FALSE;intmain(intargc,char**argv){//Thisfunctioncreatesanewthreadandmodifiesthe'achieved'globalvariableatsomepointinthefuturedoSomethingOnAnotherThread();//Waitmaximum4secondsfor'achieved'tobeT

python Pyodbc,无法在表中创建名为 "Date"的字段

问题是我无法创建名为Date的字段(我认为是因为它是一种类型)有什么想法吗?frompyodbcimportconnect#databaseconnectconn=connect('DRIVER={MicrosoftAccessDriver(*.mdb)};DBQ=test.mdb')cursor=conn.cursor()#sqlqueryexecutequery="createtableMyTable(namevarchar(30),ageinteger,Datedate)"cursor.execute(query)#commitchangesconn.commit()conn.c