jonathanduane2010
asked on
VB Programming and problems on startup and Login
Hi,
I have a system that copies files depending on whether the vpn connection is up or not, and when the machine starts i run the following script (manually) which runs other scripts and batch files in the directory and they all run fine. (its called run.vbs)
On Error Resume Next
dim WshShell
set WshShell = CreateObject("WScript.Shel l")
WshShell.Run "wscript.exe UTVCopyfilesfromserver.vbs ", 2, FALSE
WScript.Sleep 3000
WshShell.Run "wscript.exe irnCopyfilesfromservertext .vbs", 2, FALSE
WScript.Sleep 3000
WshShell.Run "wscript.exe utvnewsaudioconversion.vbs ", 2, FALSE
WScript.Sleep 3000
WshShell.Run "wscript.exe irnnewsaudioconversion.vbs ", 2, FALSE
WScript.Sleep 3000
WshShell.Run "wscript.exe UTVscriptexttonews.vbs", 2, FALSE
WScript.sleep 3000
WshShell.Run "wscript.exe irnscriptexttonews.vbs", 2, FALSE
WScript.Sleep 3000
WshShell.Run "wscript.exe irnCopyfilesfromserveraudi o.vbs", 2, FALSE
WScript.Sleep 3000
WshShell.Run "cmd.exe /c copytoirnboxirntxt.bat", 2, FALSE
WshShell.Run "cmd.exe /c copytoirnboxutvaudio.bat", 2, FALSE
WshShell.Run "cmd.exe /c copytoirnboxutvtext.bat", 2, FALSE
WshShell.Run "cmd.exe /c irnaudiorobocopy.bat", 2, FALSE
But if the vpn connection goes down the machine restarts and i then i have a batch file that runs the run.vbs file and its called runf.bat and this is it
cd /D "%~dp0"
cscript run.vbs %*
But whenever the batch file runs on login (windows logs in automatically) the run.vbs runs but the scripts inside don't seem to run properly
Is there a program or something i can do to make sure they all run fine when machine restarts unattended.
also the reason i have it running as a batch file is because i can then tell that the scripts are running by being able to see the black boxes
I have a system that copies files depending on whether the vpn connection is up or not, and when the machine starts i run the following script (manually) which runs other scripts and batch files in the directory and they all run fine. (its called run.vbs)
On Error Resume Next
dim WshShell
set WshShell = CreateObject("WScript.Shel
WshShell.Run "wscript.exe UTVCopyfilesfromserver.vbs
WScript.Sleep 3000
WshShell.Run "wscript.exe irnCopyfilesfromservertext
WScript.Sleep 3000
WshShell.Run "wscript.exe utvnewsaudioconversion.vbs
WScript.Sleep 3000
WshShell.Run "wscript.exe irnnewsaudioconversion.vbs
WScript.Sleep 3000
WshShell.Run "wscript.exe UTVscriptexttonews.vbs", 2, FALSE
WScript.sleep 3000
WshShell.Run "wscript.exe irnscriptexttonews.vbs", 2, FALSE
WScript.Sleep 3000
WshShell.Run "wscript.exe irnCopyfilesfromserveraudi
WScript.Sleep 3000
WshShell.Run "cmd.exe /c copytoirnboxirntxt.bat", 2, FALSE
WshShell.Run "cmd.exe /c copytoirnboxutvaudio.bat",
WshShell.Run "cmd.exe /c copytoirnboxutvtext.bat", 2, FALSE
WshShell.Run "cmd.exe /c irnaudiorobocopy.bat", 2, FALSE
But if the vpn connection goes down the machine restarts and i then i have a batch file that runs the run.vbs file and its called runf.bat and this is it
cd /D "%~dp0"
cscript run.vbs %*
But whenever the batch file runs on login (windows logs in automatically) the run.vbs runs but the scripts inside don't seem to run properly
Is there a program or something i can do to make sure they all run fine when machine restarts unattended.
also the reason i have it running as a batch file is because i can then tell that the scripts are running by being able to see the black boxes
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
and if so is there anyway of telling if they will?