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=oExecObje ct.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?
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>
which is executed like this:
Set oExecObject = g_oShell.Exec(strCmd)
strReturnedValue=oExecObje
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Regards,
Rob.