#32960 - 2002-11-20 11:40 AM
How to implement doing a 'dir' and executing al .exe files in it...
|
bpsysadmin
Fresh Scripter
Registered: 2002-10-18
Posts: 20
|
Hi,
I'm making an hotfix script but it is stupid to put all hotfix.exe files in it manually.
So i want to do something like this:
Doing a 'dir' of X:\xpfixes and then executing all the .exe files in the X:\xpfixes directory.
Like if the filelisting of X:\xpfixes whould be:
q1.exe q2.exe q3.exe
then I want the script to start the q1.exe then the q2.exe and then the q3.exe
If I place another q in the directory like q4.exe I want it to excecute too, next time the script starts..
(It's only this part I still need, the rest of the script is done. Just need the 'dir' thingy to work )
hopefully you guys could help me out?
|
|
Top
|
|
|
|
#32961 - 2002-11-20 11:50 AM
Re: How to implement doing a 'dir' and executing al .exe files in it...
|
Vig
Starting to like KiXtart
Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
|
This is what I use in one of my scripts.
code:
$Hot = Dir("%SYSTEMROOT%\TEMP\Hotfixes") While $Hot <> "" If InStr($Hot,".") <> 1 Shell '%comspec% /c %SYSTEMROOT%\TEMP\Hotfixes\$Hot /u /o /z /q' EndIf $Hot = Dir() Loop
|
|
Top
|
|
|
|
#32962 - 2002-11-21 12:13 AM
Re: How to implement doing a 'dir' and executing al .exe files in it...
|
bpsysadmin
Fresh Scripter
Registered: 2002-10-18
Posts: 20
|
really much thanks! W0rks!
|
|
Top
|
|
|
|
#32964 - 2002-11-20 02:59 PM
Re: How to implement doing a 'dir' and executing al .exe files in it...
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Can I ask why you use -
Shell '%comspec%..
With Windows HotFixes they are all windows programs.. Qxxxxx.exe files, etc. you should be able to do -
RUN '%SYSTEMROOT%\TEMP\Hotfixes\$Hot /u /o /z /q'
Thanks,
Kent
|
|
Top
|
|
|
|
#32967 - 2002-11-20 03:38 PM
Re: How to implement doing a 'dir' and executing al .exe files in it...
|
bpsysadmin
Fresh Scripter
Registered: 2002-10-18
Posts: 20
|
I Used it with the SHELL command, without COMSPEC And yes, yo'all right: You must use SHELL and not RUN cause with RUN kix whouldnt wait until every hotfix is finished...but just starts them all
|
|
Top
|
|
|
|
#32973 - 2002-11-20 04:50 PM
Re: How to implement doing a 'dir' and executing al .exe files in it...
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
|
|
Top
|
|
|
|
#32974 - 2002-11-20 05:29 PM
Re: How to implement doing a 'dir' and executing al .exe files in it...
|
Vig
Starting to like KiXtart
Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
|
quote: Gotta love how these thread run-on...
No kidding...
I honestly believe some people only post to point out flaws in other peoples scripts and then make up stuff after that.
The subject of this post was "How to implement doing a 'dir' and executing al .exe files in it..."
At no time did it become about applying security patches, checking for security patches, installing patches with admin privledges.
I guess I really need to watch every single word in everything I post. I'm sorry bpsysadmin I should have known better than to leave the word "hotfix" in a post.
Some of you might as well put a link to ABC's of KiXtart board etiquette and message to new forum users in your sig as often as you use it in your messages.
I doubt I'd still be using Kixtart if I had received the welcome I see most new people getting these days.
If the shoe fits wear it...
Sorry, but thats just been building up[/RANT]
|
|
Top
|
|
|
|
#32978 - 2002-11-21 07:16 AM
Re: How to implement doing a 'dir' and executing al .exe files in it...
|
Vig
Starting to like KiXtart
Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
|
quote: If the realization that your first blush at a problem was a brain fart embarrases you, then perhaps a public forum isn't for you. Analysis of a half-baked idea should not be construed as a personal attack.
I may have missed something but how should I be embarrased about my original post and how was it a half baked idea?
I showed an easy and yes a proper way to accomplish executing all .exe's in a directory (which is the subject of the post) and it seems to have worked for him. I fail to see your point.
Jens, your right he did mention hotfix in his post and I appoligize for raving like a mad man about that.
I'm not going to sit here and point out all of the unfounded assumptions made, that would serve little purpose I don't want to point any fingers. Some people just seem to be a bit "red pen" happy and often attempt to correct what was never asked.
This is not the proper place for this type of discussion so I ask any further comments be emailed.
Thanks,
ag4634@hotmail.com
|
|
Top
|
|
|
|
#32979 - 2002-11-21 02:41 PM
Re: How to implement doing a 'dir' and executing al .exe files in it...
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 895 anonymous users online.
|
|
|