Jump to content

Drivejunky95

Member
  • Posts

    6
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About Drivejunky95

Profile Information

  • OS
    Windows 7 x64

Drivejunky95's Achievements

0

Reputation

  1. Awesome man! You killed it! Set the NEQ error level to 1 and "IF ERRORLEVEL NEQ" fixed it! Just for giggles I tried it in the original script and it worked! So that means using the ERRORLEVEL syntax like this in Windows 7 returns negative values!
  2. Almost works, Example.bat @echo off cd /d H:\pathStart /b program.exe cd /d C:\pathcall Filename.bat And inside Filename.bat@echo off:looptimeout /t 10 > NULxcopy /y "C:\path" "H:\path" /dTaskList /nh /fi "IMAGENAME eq program.exe" | find "program.exe" 2>&1 > nulIF ERRORLEVEL 1 goto loop exit This is working, but the looping error level section is exiting while program.exe is still open
  3. Ok, When I start program.exe I also want a looping batch file to start (see Filename.bat). This will save new files from program.exe to another directory. What isn't happening is when I close program.exe, the looping batch file is not closing, hence the **taskkill /f /im cmd.exe /t** I think I have narrowed it down some. Filename.bat @echo off:loopxcopy /y "C:\path" "H:\path" /dtimeout /t 20goto loop So using: Example.bat @echo off cd /d "H:\path" program.exe cd /d "C:\path" call Filename.bat :CHECK timeout /t 10> nul TaskList /nh /fi "IMAGENAME eq program.exe" | find "program.exe" 2>&1 > nul IF ERRORLEVEL 1 GOTO CHECK taskkill /f /im cmd.exe /t Works, but prevents the CHECK due to no return of control from the looping Filename.bat
  4. No problem:) Filename.bat is a looping xcopy /d with 5min timeout Program.exe is an application that makes frequent saves I need something that will start the .bat and the program, then close the .bat when the program is closed.
  5. Hi all I am new (today) to machine script. This is something I put together and will be trying tomorrow. cd /d "C:\path" Start Filename.bat cd /d "H:\path" Start Program.exe :CHECK ping -n 10 localhost 1> NUL TASKLIST /v /fi "IMAGENAME eq program.exe" 2>&1 > NUL IF ERRORLEVEL 1 GOTO CHECK taskkill /f /im cmd.exe /t If all goes well, filename.bat will run. Then a program will run. CMD will then check for program.exe until not found (exited), then close CMD. In this case program.exe does not work with start /wait I am wondering if the check will slow down my machine if run for a few hours. I am using Windows 7 x64, SSD, 16GB RAM and AMD 8350. Considering inserting a small timeout, but seems silly. Is there a way to slow down the check, but still close immediately if program.exe is closed?
×
×
  • Create New...