CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Windows XP Batch file help needed

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 2, 2009, 09:40
Default Windows XP Batch file help needed
  #1
New Member
 
Ed
Join Date: Jul 2009
Posts: 2
Rep Power: 0
DL123 is on a distinguished road
I have a need to use a batch file to run windows update files (would prefer to use VB script, but unable too due to the method this has to be done, please don't ask me to explain).

I need for the batch to wait until the previous executable completes before running the next.

So far I have been successful using Start /w if I put nothing but start commands in the batch file, example:

Start /w <executable1> /quiet /noreset
Start /w <executable2> /quiet /noreset
etc...and this works

However, this batch assumes the files are present and only runs them sequentially.

I tried expanding the batch to check for the existance of the update first, and if present to skip to the next. If the update is not found, it copies the needed executable from a network share to the local PC and runs the executable, writes output to a file and then continues.

Unfortunately, it only partially works. Everything works up to the point of the first Start /w and then the command window closes and the executable never runs.

Here is the expanded code:

**********************************************

@Echo off

:A
If Exist "C:\Windows\$NtUninstallKB961501$ goto B
Copy "\\<path to network share and the specific executable> <path to folder on local PC> "
CD "<Path where executable was copied to>"
echo KB961501 >> %computername%.txt
Start /w WindowsXP-KB961501-x86-ENU.exe /quiet /noreset
goto B

:B
If Exist "C:\Windows\$NtUninstallKB968537$ goto COPFILE
Copy ""\\<path to network share and the specific executable> <path to folder on local PC>"
CD "<Path where executable was copied to>"
echo KB968537 >> %computername%.txt
Start /w WindowsXP-KB968537-x86-ENU.exe /quiet /noreset
goto COPFILE

:COPFILE
copy %computername%.txt "<path to copy text file to>"
goto END

:END

*************************************************

An obvious fix is to simply copy all of the updates to the local PC and then just run the batch file with all the start /w commands for each one, but that would run updates that may already exist and be inefficient, hence the desire to check and then copy/execute only the ones needed. Also, I have to do this for approximately 2500 PC's on the domain...

Any idea why everything fails when it gets to the first Start /w?
DL123 is offline   Reply With Quote

Old   July 2, 2009, 10:35
Default
  #2
New Member
 
Ed
Join Date: Jul 2009
Posts: 2
Rep Power: 0
DL123 is on a distinguished road
Okay, please disregard this question, I'm an idiot.

It's all working perfectly now....

I had the incorrect switch at the end of the executable...

It should be /norestart instead of /noreset...
and also I had an open parents on the path to the executable, but no close parents on the other end.

GAH!

This is why I never aspired to be a programmer...
DL123 is offline   Reply With Quote

Old   July 3, 2009, 09:53
Default
  #3
Member
 
CJ
Join Date: Jun 2009
Posts: 34
Rep Power: 17
solefire is on a distinguished road
this is funny!
solefire is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM Install Script ljsh OpenFOAM Installation 82 October 12, 2009 12:47
[OpenFOAM] ParaView 33 canbt open OpenFoam file hariya03 ParaView 7 September 25, 2008 18:33
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00
Batch File fo Fluent & Fieldview Oliver FLUENT 0 July 14, 2000 14:12


All times are GMT -4. The time now is 00:54.