Jump to content

finshore

Member
  • Posts

    6
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About finshore

finshore's Achievements

0

Reputation

  1. I was able to take the loop out of the first script and use "start /wait" instead, works really nice, no errors. @echo off start /b /wait taskkill /FI "status eq running" /IM dn.exe start /b /wait xcopy "%~dp0script\dn" "%~dp0dn\dn.ini" /y start %~dp0script\dn.vbs start %~dp0dn\dn.exe
  2. Thanks, it works real good. I like the "start /wait" and "&&", didnt know about them before. Only altered a couple things. I put % around the variable before taskkill, and removed the condition for starting dn.exe at the bottom, because i want that to start no matter what.
  3. Think i found a solution. Enclosed the file copy in a loop that tested the file for change. SET DIR=%~dp0 taskkill /FI "status eq running" /IM dn.exe :TEST xcopy "%DIR%script\dn" "%DIR%dn\dn.ini" /y find /c "%6419%" "%DIR%dn\dn.ini" REM 6419 being a new block of text that was changed by xcopy IF %ERRORLEVEL% == 1 goto TEST start script\dn.vbs start dn\dn.exe pause
  4. To clarify, I do need to stop dn.exe and start it again with the new dn.ini settings registered.
  5. Ok, sorry, I wasn't sure what was causing the fail before, but it seems that it cannot xcopy to dn.ini because dn.exe is trying to utilize it when it starts up. So i just need to make sure xcopy completes before dn.exe starts again, but I am able to xcopy before killing dn.exe. and yes dn is just a text file with no extension.
  6. This batch runs good until i stress test it by running it a lot. The copy command that is supposed to change dn.ini does not seem to execute when it fails. SET DIR=%~dp0 taskkill /FI "status eq running" /IM dn.exe xcopy "%DIR%script\dn" "%DIR%dn\dn.ini" /y start script\dn.vbs start dn\dn.exe pause Let me explain exactly what im trying to do in case im doing it wrong: first sets current directory to %dir% so i can place it anywhere then it closes dn.exe then copys over dn.ini which is used by dn.exe then runs a .vbs script which just simulates a keypress then it starts dn.exe again I am not a programmer so I don't know if there is a real simple fix. But I was wondering if i could move my copy command and create a call to it to ensure that it executes. Would that work and how would i do it?
×
×
  • Create New...