Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code Issues

Status
Not open for further replies.

mbp007

Technical User
Nov 2, 2012
13
US
Hello,
I have below code. I can't figure out to get the filename the way i want.

Here is the current filename it creates when the code runs: DXD EC - Non Updated PCs_11192012_8 0.log
I would like to get the filename as this when the code runs: DXD EC - Non Updated PCs_11192012_0800.log (Two digit hour and two digit minutes).

Please help.

Code:
DIM strDateTime

strDateTime = Now

Dim DomainName : DomainName = "%"
Dim OnlyCheckClientsInTempGroup : OnlyCheckClientsInTempGroup = True
Dim SilentMode : SilentMode = False
Dim EnableLogging : EnableLogging = True
Dim sLogFile : sLogFile = "C:\AV Ops\Reports\Move Scripts\DXD\DXD EC - Non Updated PCs_" & Month(strDateTime) & Day(strDateTime) & Year(strDateTime) &"_" & Hour(strDateTime) &" " & Minute(strDateTime) & ".log"
 
What about this ?
... & Right("00" & Month(strDateTime),2) & Right("00" & Day(strDateTime),2) & Year(strDateTime) & "_" & Right("00" & Hour(strDateTime),2) & Right("00" & Minute(strDateTime),2) & ".log"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top