[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Script Time Question  Leading 0

Posted on 2006-05-23
2
Medium Priority
?
205 Views
Last Modified: 2011-10-03
Hello,

SET t1=%TIME:~0,2%
SET t2=%TIME:~3,2%
SET t3=%TIME:~6,4%
SET g1=%DATE:~4,2%
SET g2=%DATE:~7,2%
SET g3=%DATE:~10,4%


I use the above to get the time into chunks.

and them in a file.

move  myFile.txt    myFile-%g1%_%g2%_%g3%-%t1%_%t2%_%t3%.txt

It works fine as long as there is a 2 digit hour such as 10 11 or 12

If it is 7AM  how can I get the hour above to have a leading 0?   such as 07  instead of just 7

T1 above is what holds the hour.


Thanks!

Randy
0
Comment
Question by:rjohnsonjr
2 Comments
 
LVL 9

Accepted Solution

by:
vsg375 earned 2000 total points
ID: 16741561
Hi

If I guess well, it seems that you want to add date and time to your filename. I've tried to deal with that problem and finally gave up, because there is an excellent piece of software doing that for you :

http://www.informatics-consulting.de/software/namedate.htm

HTH
Cheers
0
 
LVL 6

Author Comment

by:rjohnsonjr
ID: 16741791
Thanks man,  This is an awesome utility
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

873 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