VB Script Help
#1
Hello all.
I need some help with some VB.
Basically i need the code to check if a file exists, and if that file exists, run a batch file, if not, goto end.
Any help would be appreciated!
I need some help with some VB.
Basically i need the code to check if a file exists, and if that file exists, run a batch file, if not, goto end.
Any help would be appreciated!
#4
Scooby Regular
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like
on
1 Post
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\FSO\ScriptLog.txt") Then
Set WshShell = WScript.CreateObject("WScript.Shell")
cmd= "start blah.bat"
WshShell.Run (cmd)
Else
Wscript.Echo "File does not exist."
End If
may do it.
If objFSO.FileExists("C:\FSO\ScriptLog.txt") Then
Set WshShell = WScript.CreateObject("WScript.Shell")
cmd= "start blah.bat"
WshShell.Run (cmd)
Else
Wscript.Echo "File does not exist."
End If
may do it.
Thread
Thread Starter
Forum
Replies
Last Post