Link to home
Start Free TrialLog in
Avatar of mark_667
mark_667

asked on

VBScript command output stored in return value not piped to file?

I have the following in a VBScript:

strTimeStamp=Year(NOW()) & "-" & Month(NOW()) & "-" & Day(NOW()) & "_" & Hour(NOW()) & "-" & Minute(NOW()) & "-" & Second(NOW())

strCmd=g_strDblQuote & g_strPathToMySQLDump & g_strDblQuote & " --add-drop-table --user=root --password=<password-here> --databases db > " & g_strSavePath & strTimeStamp & ".sql"

which is executed like this:
Set oExecObject = g_oShell.Exec(strCmd)
strReturnedValue=oExecObject.StdOut.ReadAll

for some reason the output is being stored in the variable that holds the return value, not the file specified in the command string. Can anyone tell me why this is and how I can correct it?
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the grade.

Regards,

Rob.