Search found 8 matches

by plank
31 May 2011 04:40
Forum: DOS Batch Forum
Topic: Batch script variables not working as expected
Replies: 15
Views: 12603

Re: Batch script variables not working as expected

Thank you so much! It now works perfectly.

Your a star!
by plank
31 May 2011 04:17
Forum: DOS Batch Forum
Topic: Batch script variables not working as expected
Replies: 15
Views: 12603

Re: Batch script variables not working as expected

This code: @echo off set CURRENTVERSION=10_03_00_136 set SIGFILE=%windir%\Deploy\Salto.sig set VERSION=X IF NOT EXIST %SIGFILE% ( call :Install exit /b ) ELSE ( for /f %%a in (%SIGFILE%) do ( echo "%%a" set "VERSION=%%a" echo "VERSION AFTER %VERSION%" ) IF %VERSION%==%C...
by plank
31 May 2011 04:06
Forum: DOS Batch Forum
Topic: Batch script variables not working as expected
Replies: 15
Views: 12603

Re: Batch script variables not working as expected

Ok. So back to my original code. here is what i run: If i run this @echo off set CURRENTVERSION=10_03_00_136 set SIGFILE=%windir%\Deploy\Salto.sig set VERSION=X IF NOT EXIST %SIGFILE% ( call :Install exit /b ) ELSE ( for /f %%a in (%SIGFILE%) do ( echo VERSION %VERSION% echo %%a set VERSION=%%a echo...
by plank
31 May 2011 03:58
Forum: DOS Batch Forum
Topic: Batch script variables not working as expected
Replies: 15
Views: 12603

Re: Batch script variables not working as expected

Yeah - i am looking to see if that is the ONLY thing in a file. It should contain a version number for a piece of software. If the version number from the file is incorrect it needs to uninstall the software and install the latest version. I have obviously cut those bits out of the script. If i run ...
by plank
31 May 2011 03:49
Forum: DOS Batch Forum
Topic: Batch script variables not working as expected
Replies: 15
Views: 12603

Re: Batch script variables not working as expected

I still have

C:\>dfs-install-salto.cmd
VERSION X
'C:\Windows\Deploy\Salto.sig'
VERSION AFTER C:\Windows\Deploy\Salto.sig
INSTALL
Press any key to continue . . .
by plank
31 May 2011 03:41
Forum: DOS Batch Forum
Topic: Batch script variables not working as expected
Replies: 15
Views: 12603

Re: Batch script variables not working as expected

Thanks for the response. However the result is even wierder now

VERSION X
C:\Windows\Deploy\Salto.sig
VERSION AFTER C:\Windows\Deploy\Salto.sig
INSTALL

The file contains one line that says 10_03_00_136

Dan
by plank
31 May 2011 03:25
Forum: DOS Batch Forum
Topic: Batch script variables not working as expected
Replies: 15
Views: 12603

Re: Batch script variables not working as expected

Forgot to mention. If i run the code, it brings back that result. If i then remove the set line for VERSION at the top then run it in the same DOS window it works perfectly.

However it wont run without this line normally because of the null variable doesnt run with the IF statement.

Thanks

Dan
by plank
31 May 2011 03:23
Forum: DOS Batch Forum
Topic: Batch script variables not working as expected
Replies: 15
Views: 12603

Batch script variables not working as expected

Hey all, I have this code @echo off set CURRENTVERSION=10_03_00_136 set SIGFILE=%windir%\Deploy\Salto.sig set VERSION=X IF NOT EXIST %SIGFILE% ( call :Install exit /b ) ELSE ( for /f %%a in (%SIGFILE%) do ( echo VERSION %VERSION% echo %%a set VERSION=%%a echo VERSION AFTER %VERSION% ) IF %VERSION%==...