Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

The Start cmd command and errorlevel handling


  • Please log in to reply
2 replies to this topic
juandante
  • Members
  • 12 posts
  • Last active: Dec 12 2011 10:42 PM
  • Joined: 10 Dec 2011
Hello,

I need to run a software full screen and for this I'm using this batch command :

FOR %%f IN ("%imgpath%\*.iim") DO (

start /max /wait "" "%pf%\S86.exe"

IF errorlevel == 0 start /max /wait "" "%pf%\S86.exe" -img "%%f"

)



But the problem is that IF command seems to receive the errorlevel of the Start command and never the one of S86.exe.

How to bypass this ?

Someon gave me this vbs script but I dont know how to open S86 in full screen (maximized) with it :


set s861= CreateObject ("S86x")
err = -1
for each imgs in [c]
do while (err < 0 ) 'repeat until success
err = S86(imgs)
loop
next

Or if there is a way to run this with autohotkey (with was my initial idea but I am not good at ahk)

Thanks for your help

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
I believe the equivalent of 'start' is runwait. you'll have to read the docs on how to retrieve errorlevel from "S86"
<!-- m -->http://www.autohotke...ommands/Run.htm<!-- m -->

There is a for command, but I believe this would be better Loop (parse a string)
<!-- m -->http://www.autohotke...s/LoopParse.htm<!-- m -->

I'm not sure how you would access "imgpath"

>>for each imgs in [c]
the equivalent is <!-- m -->http://www.autohotke...ds/LoopFile.htm<!-- m -->

juandante
  • Members
  • 12 posts
  • Last active: Dec 12 2011 10:42 PM
  • Joined: 10 Dec 2011
Big f*****g thanks man this is exacly what I was looking for !!!!!!!!!!!!!! :shock: :shock: :shock: And it works GREAAAT You are my today's hero !!!!!!!!!!!! :D :D :D :D :D :D


Loop, C:\img\*.img
{

RunWait C:\Program Files\S86.exe -img "%A_LoopFileFullPath%", , Max UseErrorLevel

If ErrorLevel!=1
RunWait F:\Program Files\iMacros\S86.exe -img "%A_LoopFileFullPath%", , Max


}