Hi,
I have a problem with a vbscript.
This script runs several executable and batch files. when I run the script in a command prompt, all is working correctly. However, when I runs it in explorer (double click on it) on by the task scheduler, it does not seems to work (it does not execute all the commands).
Any help will be greatly appreciated.
Here is the code:
---
Dim objShell
Set objShell = wscript.CreateObject("WScript.Shell")
'=============================
dtmToday = Date()
dtmLastMonth = Date() - 31
'========================================================
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\rptconnect start batch",1,TRUE)
'========================================================
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\sdrptrun.bat C:\authmgr\utils\cust_rpt\pcaccept.p" &chr(32) &dtmLastMonth &chr(32) &dtmToday,1,TRUE)
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\sdrptrun.bat C:\authmgr\utils\cust_rpt\pcincorr.p" &chr(32) &dtmLastMonth &chr(32) &dtmToday,1,TRUE)
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\sdrptrun.bat C:\authmgr\utils\cust_rpt\sdastart.p" &chr(32) &dtmLastMonth &chr(32) &dtmToday,1,TRUE)
'========================================================
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\rptconnect stop batch",1,TRUE)
---
I have a problem with a vbscript.
This script runs several executable and batch files. when I run the script in a command prompt, all is working correctly. However, when I runs it in explorer (double click on it) on by the task scheduler, it does not seems to work (it does not execute all the commands).
Any help will be greatly appreciated.
Here is the code:
---
Dim objShell
Set objShell = wscript.CreateObject("WScript.Shell")
'=============================
dtmToday = Date()
dtmLastMonth = Date() - 31
'========================================================
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\rptconnect start batch",1,TRUE)
'========================================================
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\sdrptrun.bat C:\authmgr\utils\cust_rpt\pcaccept.p" &chr(32) &dtmLastMonth &chr(32) &dtmToday,1,TRUE)
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\sdrptrun.bat C:\authmgr\utils\cust_rpt\pcincorr.p" &chr(32) &dtmLastMonth &chr(32) &dtmToday,1,TRUE)
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\sdrptrun.bat C:\authmgr\utils\cust_rpt\sdastart.p" &chr(32) &dtmLastMonth &chr(32) &dtmToday,1,TRUE)
'========================================================
iReturn = objShell.Run("cmd.exe /C c:\authmgr\utils\rptconnect stop batch",1,TRUE)
---