How do I remove a certain part of a variable?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
screwed124816
Posts: 1
Joined: 11 Nov 2010 18:55

How do I remove a certain part of a variable?

#1 Post by screwed124816 » 11 Nov 2010 19:00

for example, if i set a variable as the date, 11/11/2010, what command could i use to remove the "/", making the variable 11112010?

amel27
Expert
Posts: 177
Joined: 04 Jun 2010 20:05
Location: Russia

Re: How do I remove a certain part of a variable?

#2 Post by amel27 » 12 Nov 2010 02:20

Code: Select all

@set var=11/11/2010
@set var=%var:/=%

@echo %var%
@pause>nul

Post Reply