Scripts Thread, Script to check if folder exists, if not, run a exe file in Coding and Web Development; I need a request for a script similar to my last one.
I need this script to look for a ...
-
28th March 2006, 03:36 PM #1 Script to check if folder exists, if not, run a exe file
I need a request for a script similar to my last one.
I need this script to look for a folder in
c:\windows\system32\foldername.
If this folder exists then i want the script to stop. If the folder does not exist then i want the script to run a .exe file from the server toinstall a piece of software. ie
\\servername\folder\software.exe.
There will be file sin the folder in c:\windows\system32\foldername but i only wnat it to look at the folder not its contents.
Any suggestions please.?
-
-
IDG Tech News
-
28th March 2006, 04:13 PM #2 Re: Script to check if folder exists, if not, run a exe file
Code:
if exist "C:\windows\system32\foldername" goto end
\\servername\folder\software.exe
:end
Should do it
-
-
28th March 2006, 07:14 PM #3 Re: Script to check if folder exists, if not, run a exe file
drop the above in a .bat file?
-
-
28th March 2006, 07:50 PM #4 Re: Script to check if folder exists, if not, run a exe file
Yes put it in a bat or cmd file.
I couldnt be doing without my scripting skills these days it saves you so much time and manual effort it's well worth putting the time in to learn
-
-
28th March 2006, 07:53 PM #5 Re: Script to check if folder exists, if not, run a exe file
@ChrisH
I'd love to learn Chris, have you any recomendations for me to start as a beginner? Books or web sites?
I need basic on all sorts of scripting. I have lots of very useful scripts but i have only experience of tweaking other peoples scripts. lol
-
-
28th March 2006, 09:00 PM #6 Re: Script to check if folder exists, if not, run a exe file
@tosca925: Check out the Scripting Centre over at www.technet.com - IMHO the best place to start learning. Lots of examples and you can download a help file with the vast majority of the functions that you need - copy and paste and hack to begin with and eventually you'll be able to start from scratch (when necessary).
-
-
28th March 2006, 10:53 PM #7 Re: Script to check if folder exists, if not, run a exe file
Theres a few resources listed in the scripting forum as well here
-
-
29th March 2006, 08:24 AM #8 Re: Script to check if folder exists, if not, run a exe file
I found Steve Rochford's Scripting 101 course that he gave at the Edugeek conference extremely useful - don't know if he'd be willing to let you have a copy?
-
-
19th December 2006, 04:55 PM #9 Re: Script to check if folder exists, if not, run a exe file
any chance I could get a copy of that, after all it is christmas ? LOL
-
-
19th December 2006, 11:08 PM #10 Re: Script to check if folder exists, if not, run a exe file
Resources are still available on the conference website.
-
-
20th December 2006, 12:32 AM #11 Re: Script to check if folder exists, if not, run a exe file
const Folder_Path = "c:\windows\system32\foldername"
const Exe = "\\servername\folder\software.exe"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
If FSO.FolderExists(Folder_Path) = true then
Wscript.Quit
Else
WshShell.Run Exe
EndIf
-
-
20th December 2006, 08:53 AM #12
- Rep Power
- 0
Re: Script to check if folder exists, if not, run a exe file

Originally Posted by
GrumbleDook Resources are still available on the conference website.
http://www.edugeekconference.net/ind...id=7&Itemid=59
Is that where the resources are? I cannae see them!
-
-
20th December 2006, 09:41 AM #13 Re: Script to check if folder exists, if not, run a exe file
Apologies ... most of the first conference is still held on the Wiki ...
a direct link to the 2005 conference is here and the scripting resources are here
-
-
20th December 2006, 04:58 PM #14 Re: Script to check if folder exists, if not, run a exe file
@tosca925
I've found AutoIt very simple to get into and I also use WPkg to deploy some applications and it has inbuilt folder/file checking to decide whether to isntall software or not.
regards
Simon
-
-
20th December 2006, 05:41 PM #15 Re: Script to check if folder exists, if not, run a exe file

Originally Posted by
gecko const Folder_Path = "c:\windows\system32\foldername"
<snip>
Less is more.. if you can do it with one line of batch file then that's usually the way to go. I'd do the one above, but with a "not":
if not exist <somepath> <dosomething>
-
SHARE: 
Similar Threads
-
By netadmin in forum Web Development
Replies: 2
Last Post: 22nd April 2007, 03:47 AM
-
By contink in forum Scripts
Replies: 4
Last Post: 25th December 2006, 09:15 PM
-
By tosca925 in forum How do you do....it?
Replies: 4
Last Post: 2nd October 2006, 08:15 PM
-
By tosca925 in forum Scripts
Replies: 4
Last Post: 23rd March 2006, 06:27 AM
-
By tosca925 in forum Scripts
Replies: 3
Last Post: 1st March 2006, 12:08 PM
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules