Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

VB Script Help

Thread Tools
 
Search this Thread
 
Old Sep 19, 2003 | 02:45 PM
  #1  
Davie's Avatar
Davie
Thread Starter
Scooby Regular
 
Joined: Sep 2002
Posts: 530
Likes: 0
Post

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!
Reply
Old Sep 19, 2003 | 03:09 PM
  #2  
JackClark's Avatar
JackClark
Scooby Senior
25 Year Member
Liked
Loved
Community Favorite
 
Joined: Dec 2000
Posts: 20,896
Likes: 53
From: Overdosed on LCD
Post

Can't you just add the check to the beginning of the batch file?
Reply
Old Sep 19, 2003 | 03:17 PM
  #3  
JackClark's Avatar
JackClark
Scooby Senior
25 Year Member
Liked
Loved
Community Favorite
 
Joined: Dec 2000
Posts: 20,896
Likes: 53
From: Overdosed on LCD
Post

echo off
IF EXIST C:\scooby.doc GOTO Scooby
Goto end
:Scooby
ECHO Scooby
:end
Reply
Old Sep 19, 2003 | 04:20 PM
  #4  
David_Wallis's Avatar
David_Wallis
Scooby Regular
 
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
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.
Reply
Old Sep 19, 2003 | 06:36 PM
  #5  
Davie's Avatar
Davie
Thread Starter
Scooby Regular
 
Joined: Sep 2002
Posts: 530
Likes: 0
Post

Cheers,

I'll give that a try.
Reply
Old Sep 19, 2003 | 07:04 PM
  #6  
Soulgirl's Avatar
Soulgirl
Scooby Regular
 
Joined: Dec 2002
Posts: 5,145
Likes: 0
From: Here!
Post

My husband says Daves reply is the best
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
m18use
Computer & Technology Related
4
Sep 5, 2002 09:00 PM
Ricochet
Computer & Technology Related
10
Aug 26, 2002 07:02 PM




All times are GMT +1. The time now is 10:27 AM.