windows - passing a parameter from a vbscript to a batch file -



windows - passing a parameter from a vbscript to a batch file -

i have batch file calling vbscript. vbscript homecoming current date time stamp. can please tell me how can pass datestamp value batch script . using wscript.echo dont want utilize :

batch file :

wscript "c:\script.vbs" "c:\log.txt"

vb script :

set objargs = wscript.arguments dim objfso, objfile, logfile logfile = wscript.arguments(0) set objfso = createobject("scripting.filesystemobject") set objfile = objfso.getfile(logfile) wscript.echo objfile.datelastmodified end if

can 1 tell me can in above script pass datelastmodified batch file ? not want utilize wscript.echo ...

@for /f "tokens=* delims=" %%# in ('cscript /nologo "c:\script.vbs" "c:\log.txt"') @set "result=%%#"

now can utilize %result% variable.

wscript pop-up result.from command line/bat improve utilize cscript.

you can embed vbscript code batch

windows batch-file vbscript batch-processing

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -