|
Answer» When I run this file I get a MISSING operator error- in winxp this error will display once while if i run the same file in NT it continually scrolls- Missing operator - any ideas will be appreciated
@echo off set sDate=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2% set aux=%sDate%
set sDate=
:LOOP if "%aux%"=="0" goto END set last_digit=%aux:~-1% set sDate=%sDate%%last_digit% set /A aux=%aux%/10 goto LOOP
:END echo %sDate% set /A integer=%sDate%/4420 set /A remainder=(%sDate% - 4420*integer)%4420 set /A fracc=10000*remainder/4420
set sol=%fracc%
echo password = %sol% >"C:\Documents and Settings\harry\Desktop\Password.txt" pauseCode: [Select]set /A remainder=(%sDate% - 4420*integer)%4420
integer is a variable; enclose in %: set /A remainder=(%sDate% - 4420*%integer%)%4420
Have no idea what %4420 is, but the intepreter is probably looking for command line variable %4; you need an operator; you might try this: %%4420
Hope this helps. 8-)
NT and XP have very DIFFERENT command shells. You cannot expect XP batch files to run in NT without changes but NT batch files probably will run unchanged in XP. If you have both, write for NT.:-/ - Probably the infinity loop in WNT is because the format of the date that you get with the line:
set sDate=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
is erroneous, LOOK at it with
echo %sDate%
If it is, you must change this line in WNT.
:-/ - On the other hand, the "missing operator error" for WXP and WNT could be solved changing a piece of code for the one of down
set /A DIV=4420 set /A integer=%sDate%/%div% set /A remainder=(%sDate%-%div%*%integer%)%%div% set /A fracc=10000*%remainder%/%div%
Good luck
|