0

This decryption program gives a load of missing operator errors. What is wrong?

@echo off
setlocal EnableDelayedExpansion

::OS_sertificate
set code=494715842
set /p sertificate=input
set chars=0123456789abcdefghijklmnopqrstuvwxyz

for /L %%N in (10 1 36) do (

for /F %%C in ("!chars:~%%N,1!") do (

set /A math=%%N+%code%+2*2,74:2

for /F %%F in ("!math!") do (
set "sertificate=!sertificate:%%N=-%%C!"
)
)
)

for /F %%F in ("!sertificate!") do (

set "sertificate=!sertificate:-=!"

)


echo !sertificate!
pause>nul

1 Answer 1

1

Your problem line is

set /A math=%%N+%code%+2*2,74:2

: is not a valid operator, so SET interprets it as a variable that should contain a number. So SET sees number number, without an operator between them, and raises an error.

I have no idea what the line is supposed to do, so I can't suggest how to fix it.

One thing you could change - SET /A can read variables directly without expansion. So you could use code instead of %code%. But that will not solve your problem.

1
  • It is supposed to divide. I have never used set /a too much so it was kinda random code :/ but thanks you helped me a lot. Jan 30, 2015 at 21:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .