Jump to content

[Self Solved] I need help understanding and modifying this code

LewisSpring
Go to solution Solved by LewisSpring,
Just now, GER_T4IGA said:

I still don't fully understand what this is supposed to be used for but then I am also a terrible programmer.

I need it to open ETS2, and when it's closed It copies the game files from its folder to another.

I tried start /wait but I it didn't wait as the Steam updater stopped me and always will show.

I've been trying to play the same game of EuroTruckSimulator2 on two pcs. 

I've opted to use batch and Dropbox.

 

I've tried writing my own code, which works but I then found out about Steam's updating process and needed to fit that into my code. It'd be impossible, I found this code:

WAITLOOP
tasklist /FI "IMAGENAME eq notepad.exe" 2>NUL | find /I /N "notepad.exe">NUL
if "%ERRORLEVEL%"=="0" goto RUNNING
goto NOTRUNNING

:RUNNING
ping 9.9.9.9
goto WAITLOOP

:NOTRUNNING
echo its over

But I need to get it to basically:

  1. Find the updater window title(Updating - Euro.. / Ready - Euro..) which I've bodged the tasklist command into 
    tasklist /FI "WINDOWTITLE eq Ready - Euro Truck Simulator 2" 2>NUL | find /I /N "Steam.exe">NUL

    where if I run the first half on its own it finds it, but It still can't detect steam which is running that window when used as a whole. It will then use the running loop

  2. Then I need it find the ETS2 exe running if the Updaters aren't running and continue the running loop.

  3. Then after that, I need it to run 

    xcopy "C:\Users\Mineb\Documents\Euro Truck Simulator 2" "C:\Users\Mineb\Dropbox\EUROTRUCK" /E /H /Y
    REM Copies files from Documents\Euro Truck Simulator 2 to Dropbox\EUROTRUCK and copies dirs and sub dirs including empty ones, copies system and hidden files and supresses prompts to overwrite 
    echo Copy Command Finished!
    echo Done!
    pause >nul
    echo Press any key to quit...
    exit

    which is my copy code.

 

I'll be mightily surprised if anyone can help out as this is probably impossible..! 

Thanks

MBTT

UTC/GMT (Except during BST)

Link to comment
Share on other sites

Link to post
Share on other sites

I still don't fully understand what this is supposed to be used for but then I am also a terrible programmer.
EDIT: Thx for clarification. Now got it :)

http://linustechtips.com/main/topic/334934-unofficial-ltt-beginners-guide/ (by Minibois) and a few things that will make our community interaction more pleasent:
1. FOLLOW your own topics                                                                                2.Try to QUOTE people so we can read through things easier
3.Use
PCPARTPICKER.COM - easy and most importantly approved here        4.Mark your topics SOLVED if they are                                
Don't change a running system

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, GER_T4IGA said:

I still don't fully understand what this is supposed to be used for but then I am also a terrible programmer.

I need it to open ETS2, and when it's closed It copies the game files from its folder to another.

I tried start /wait but I it didn't wait as the Steam updater stopped me and always will show.

UTC/GMT (Except during BST)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×