Hi can someone help me to work this out
And is is posible to have something like this...
i just need return back of this command like is it done or thera is an Error like synatax or something ...
IF (START "" "C:\Windows\system32\Notepad.exe")=True Echo OK
thanks a lot
IF command is true echo smoething
Moderator: DosItHelp
Re: IF command is true echo smoething
Hi icikato
Hope it helps,
It doesn't work like that, the if command does STRING compare only, but you can use the '&&' and '||' operators aswell as errorLevel.icikato wrote:Hi can someone help me to work this out
And is is posible to have something like this...
i just need return back of this command like is it done or thera is an Error like synatax or something ...
IF (START "" "C:\Windows\system32\Notepad.exe")=True Echo OK
thanks a lot
Code: Select all
START "" "C:\Windows\system32\Notepad.exe" &&echo.succes ||echo.failed
Code: Select all
START "" "C:\Windows\system32\Notepad.exe"
if not errorLevel 1 (echo.succes)else echo.errorLevel %errorLevel%
-
- Posts: 22
- Joined: 20 Nov 2012 12:42
Re: IF command is true echo smoething
Hi why should the file not open?
well if is realy the notepad that you want to open this code is not bullet proof .....
if is realy the notpad. the code can be bigger cause the user can be running other notepads, but i was just passing by im in a kind of hurry , let me know if the above code fits to you... or else it have to be different ,like get the notepads pid open the notepad and chek if the new notepad pid is running, if you know how to code it , do it. i got to go. regards
well if is realy the notepad that you want to open this code is not bullet proof .....
Code: Select all
start notepad.exe
tasklist | findstr "notepad.exe" || if not errorlevel 1 echo OK
if is realy the notpad. the code can be bigger cause the user can be running other notepads, but i was just passing by im in a kind of hurry , let me know if the above code fits to you... or else it have to be different ,like get the notepads pid open the notepad and chek if the new notepad pid is running, if you know how to code it , do it. i got to go. regards