Примерно так:
Код:
$sBat_Content = _
'@Echo Off' & @CRLF & _
'Set iRandom=0' & @CRLF & _
'Call :Random 1 69' & @CRLF & _
'If %iRandom% LSS 10 Set iRandom=0%iRandom%' & @CRLF & _
'Start WinstyleMonitor.exe -LP "%Windir%\Web\Wallpaper\WinStyle %iRandom%.jpg"' & @CRLF & _
'GoTo :EOF' & @CRLF & _
':Random' & @CRLF & _
':Loop' & @CRLF & _
'Set /A Rnd=%Random:~0,1%+%Random:~-2%' & @CRLF & _
'If %Rnd% LSS %1 GoTo :Loop' & @CRLF & _
'If %Rnd% GTR %2 GoTo :Loop' & @CRLF & _
'Set iRandom=%Rnd%'
$sBat_File = @ScriptDir & "\BatFile.bat"
$hFile = FileOpen($sBat_File, 2)
FileWrite($hFile, $sBat_Content)
FileClose($hFile)
Run($sBat_File)