Hello again. I am using the %date% and %time% variables in a program, but I need to take the / and the : out of them to leave me with just a number like 21072010. I know that I need to use a FOR loop, but I'm still working on how to use them.
Thanks, guys.
phillid
Remove / and : in strings
Moderator: DosItHelp
Re: Remove / and : in strings
Read set/?
Code: Select all
set "var=%var:/=%"
Re: Remove / and : in strings
Or you can use it like
Also, you can read about it with set /?
Code: Select all
set now=%time%
echo %now:~0,2%_%now:~3,2%_%now:~6,2%
Also, you can read about it with set /?