Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help with line in batch file

Posted on 2011-02-22
4
Medium Priority
?
448 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 85

Accepted Solution

by:
oBdA earned 2000 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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…
Suggested Courses

670 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