| Login

Search this Blog


Links I like to keep around


Here are the most recent postings to this blog. Use the archive calendar or search to find other entries.
Aug22

Written by:R Teachout
8/22/2007 3:01 PM 

set VAR=%VAR:/=-% would replace any / with - in a variable..

For example: %DATE% would normally be:  Wed 08/22/2007

If you ran the following in a bat script
set DATE=%DATE:/=-%
set DATE=%DATE: =-%

%DATE% would be Wed-08-22-2007 which can then be used for folder creation!!

Neato!!

 

Great Reference Page:  http://www.dostips.com/DtTipsStringManipulation.php#_Toc135152729 

Tags:

1 comment(s) so far...

Re: Dos Env Var String Replacement

I was looking for exactly for this problem and google led me here... Thank you!

By Samott on  1/7/2010 12:07 AM

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment  Cancel 

Never trust a computer you can't throw out a window.
-Steve Wozniak

Inspired by Nina