Solved

Help with line in batch file

Posted on 2011-02-22
4
401 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:aideb
4 Comments
 
LVL 7

Expert Comment

by:David_Hagerman
ID: 34950744
Have you tried putting your second argument on a second line

If %Source% == %Destin%
%Destin% = %Destin%+".000
0
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 34950785
Try
if /i "%Source%"=="%Destin%" set Destin=%Destin%.000

Open in new window

0
 
LVL 2

Author Closing Comment

by:aideb
ID: 34950823
Result!

Thanks
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34950828
Example

set Source=234
set Destin=234

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

Open in new window

0

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now