J
jg
I hope this the right group:
my .bat file seems to set environment variable from result of vbscript
but the value disappear right away!!. I said that because I saw the output
c:\>set DtRapidLstDnlod=2005-11-29 18:38:00
from the bat file was executing the line
echo 2005-11-29 18:38:00| For /F "usebackq tokens=1-2" %%i in (`cscript
//nologo "D:\util\ConvertMMM_DD_HH_MM.vbs" `) do set
DtRapidLstDnlod=%%i %%j
in a nut shell the problematic bat file statement are
echo 2005-11-29 18:38:00 | For /F "usebackq tokens=1-2" %%i in (`cscript
//nologo
"D:\util\ConvertMMM_DD_HH_MM.vbs" `) do set DtRapidLstDnlod=%%i %%j
echo @debug DtRapidLstDnlod=%DtRapidLstDnlod%
@@rem the line above shows no value in
@@rem end of bat file
Now I see output
c:\>set DtRapidLstDnlod=2005-11-29 %J
@debug DtRapidLstDnlod=
here is the code for vbs file
dim newDt , sDt, str
str = wscript.stdIn.ReadLine
newDt = Cdate(str)
sDt = "" & newDT
if len(sDt) = 17 then
sDt = "20" & sDt
End If
wscript.echo sDt
where did I go wrong? or is there a better to get result out of a script
excution.
from the output the vbscript does seem to function correctly, but somehow,
the value of variable being set gets lost. and become some funny empty
value.
I would have used vbscript for the entire task except I get in trouble with
some file IO after using FTP. At times the redirected output of FTP
is not availabe to the script when it should.. Furthermore, I already have
a template for the batch file for the task.
my .bat file seems to set environment variable from result of vbscript
but the value disappear right away!!. I said that because I saw the output
c:\>set DtRapidLstDnlod=2005-11-29 18:38:00
from the bat file was executing the line
echo 2005-11-29 18:38:00| For /F "usebackq tokens=1-2" %%i in (`cscript
//nologo "D:\util\ConvertMMM_DD_HH_MM.vbs" `) do set
DtRapidLstDnlod=%%i %%j
in a nut shell the problematic bat file statement are
echo 2005-11-29 18:38:00 | For /F "usebackq tokens=1-2" %%i in (`cscript
//nologo
"D:\util\ConvertMMM_DD_HH_MM.vbs" `) do set DtRapidLstDnlod=%%i %%j
echo @debug DtRapidLstDnlod=%DtRapidLstDnlod%
@@rem the line above shows no value in
@@rem end of bat file
Now I see output
c:\>set DtRapidLstDnlod=2005-11-29 %J
@debug DtRapidLstDnlod=
here is the code for vbs file
dim newDt , sDt, str
str = wscript.stdIn.ReadLine
newDt = Cdate(str)
sDt = "" & newDT
if len(sDt) = 17 then
sDt = "20" & sDt
End If
wscript.echo sDt
where did I go wrong? or is there a better to get result out of a script
excution.
from the output the vbscript does seem to function correctly, but somehow,
the value of variable being set gets lost. and become some funny empty
value.
I would have used vbscript for the entire task except I get in trouble with
some file IO after using FTP. At times the redirected output of FTP
is not availabe to the script when it should.. Furthermore, I already have
a template for the batch file for the task.