Jump to content

converting batch command to runonceex


Recommended Posts

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

Link to comment
Share on other sites


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

Link to comment
Share on other sites

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" )

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...