Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

User talk:Ilike2burnthing

About this board

Not editable


Batch script for Crysis

4
Vetle (talkcontribs)

I tried cleaning up your code, please try the following:

@echo off
set _im=Crysis.exe
qres.exe /r:59
timeout /t 10 > NUL
start %_im%
timeout /t 60 > NUL
:_loop
tasklist /FI "IMAGENAME eq %_im%" | findstr /I "%_im%" > NUL || goto _cleanup
timeout /t 5 > NUL
goto _loop
:_cleanup
qres.exe /r:60
Ilike2burnthing (talkcontribs)

Hi, thanks for that. I actually meant for people to clean up the code for the wiki page.


As for the .bat file, while putting the set _im= first will work for Crysis Warhead and Crysis 2, Crysis has a launch tool by a different name that you can't skip past. So you have to run crisis.exe which then launches the actual game file of crysis64.exe and that has to be monitored. Launching it directly just crashes to the desktop. So I just decided to keep the format for them all the same.


Is there any advantage to putting the >Nul at the end of the line rather than the start?

Thanks again :)

Vetle (talkcontribs)

In case of the wiki format you should use the <pre> tags, you don't need to insert <nowiki> tags into your code.


Changing the redirect location doesn't actually make a difference.[1] I have made some changes which puts the > NUL at the start and removed the _im variable:

@echo off
qres.exe /r:59
> NUL timeout /t 10
start crysis.exe
> NUL timeout /t 60
:_loop
tasklist /FI "IMAGENAME eq crysis64.exe" | > NUL findstr = || goto _cleanup
> NUL timeout /t 5
goto _loop
:_cleanup
qres.exe /r:60


Or for wiki:

<pre>
@echo off
qres.exe /r:59
> NUL timeout /t 10
start crysis.exe
> NUL timeout /t 60
:_loop
tasklist /FI "IMAGENAME eq crysis64.exe" | > NUL findstr = || goto _cleanup
> NUL timeout /t 5
goto _loop
:_cleanup
qres.exe /r:60
</pre>


References
  1. Batch files - Redirection - last accessed on 2016-07-01
Ilike2burnthing (talkcontribs)

That works perfectly for all three, thanks :)

Added those as edits now and referenced you in the summary

There are no older topics