MSFN Forum: converting batch command to runonceex - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

converting batch command to runonceex Rate Topic: -----

#1 User is offline   Radimus 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 309
  • Joined: 14-June 04

Posted 22 October 2004 - 07:14 AM

Can someone help convert the statement below into a runonce statement.

FOR /f %%f in ('dir/b/s %CDROM%\Hotfixes\Type1\*.exe') DO Start /wait "" "%%f" /z /n /o /q


Or should I just put it in a batch file and run the batch


#2 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

Posted 22 October 2004 - 08:08 AM

Well you could compile a AutoIt script to do that fuction...some thing like the below code should do all of it if not the bulk.

; Install Type 1 Hot Fixes
$search	= FileFindFirstFile ( @ScriptDir & "\Type1\*.exe" )
If $search <> -1 Then
	While 1
  $exe = FileFindNextFile ( $search )
  If @error Then ExitLoop

  RunWait ( @ScriptDir & "\Type1\" & $exe & " /z /n /o /q" , "" , @SW_HIDE )
	Wend
	FileClose	( $search )
EndIf

; Install Type 2 Hot Fixes
$search	= FileFindFirstFile ( @ScriptDir & "\Type2\*.exe" )
If $search <> -1 Then
	While 1
  $exe = FileFindNextFile ( $search )
  If @error Then ExitLoop

  RunWait ( @ScriptDir & "\Type2\" & $exe & " /Q:A /R:N" , "" , @SW_HIDE )
	Wend
	FileClose	( $search )
EndIf

Exit


#3 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

Posted 22 October 2004 - 09:01 AM

humm untested but some thing like this should work...and be fairly expandable to include other future hotfix types.


Func _HotFix( $dir , $switch )
	$search	= FileFindFirstFile ( @ScriptDir & $dir & "*.exe" )
	If $search <> -1 Then
  While 1
 	 $fix = FileFindNextFile ( $search )
 	 If @error Then ExitLoop

 	 RunWait ( @ScriptDir & $dir & $fix & $switch , "" , @SW_HIDE )
  Wend
  FileClose ( $search )
	EndIf
EndFunc

; HotFix Type 1
_HotFix ( "\Type1\" , " /z /n /o /q" )

; HotFix Type 2
_HotFix ( "\Type2\" , " /Q:A /R:N" )


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy