Link to home
Start Free TrialLog in
Avatar of aideb
aideb

asked on

Help with line in batch file

I need a quick hand with a line in a batch file

If %Source% == %Destin% %Destin% = %Destin%+".000"

It isn't working as intended.

It should (in my mind anyway) compare the two variables. If the two match, the Destin variable should have .000 appended.
e.g. JSmith becomes Jsmith.000

Thanks

Aidan
Avatar of David_Hagerman
David_Hagerman
Flag of South Africa image

Have you tried putting your second argument on a second line

If %Source% == %Destin%
%Destin% = %Destin%+".000
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aideb
aideb

ASKER

Result!

Thanks
Example

set Source=234
set Destin=234

If NOT "%Source%"=="%Destin%" GOTO NextStep
Set Destin=%Destin%.000
:NextStep
echo %Destin%

Open in new window