Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Why doesn't CMD execute within a VBS launched from Scheduler?

$
0
0
This is my VBS file contents :

Code:

dim com1, com2
com1 = "C:\windows\system32\cmd.exe /c D:\wamp\bin\mysql\mysql5.6.17\bin\mysql.exe -h xxx -u xxx -pxxx xxx < " & chr(34) & "D:\create_vox.sql" & chr(34) & chr(34)
com2 = "C:\windows\system32\cmd.exe /c D:\wamp\bin\mysql\mysql5.6.17\bin\mysql.exe -h xxx -u xxx -pxxx xxx < " & chr(34) & "D:\cdr_table.sql" & chr(34) & chr(34)
CreateObject("wscript.shell").Run com1, 10, True
CreateObject("wscript.shell").Run com2, 10, True

I run it on a schedule within Task Scheduler: with SYSTEM account, highest privileges.

I tried when the script runs alone and does what it is suppose to do. But when I run it through the scheduler, then the above second command (com2) doesn't go through.

[EDIT4]

I've tried :

changing around the intWindowStyle , set it to 0, 1 and 10.

and

Code:

Set tempob1 = CreateObject("WScript.Shell")
Set tempob2 = CreateObject("WScript.Shell")
tempob1.Run com1,,True
tempob2.Run com2,,True


Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>