none
Creating wims based on date and time

    General discussion

  • A quick tip to auto-generate wim names for capture.

    I sometimes am generating a few images at the same time, but I wanted a standard name that I didnt have to type every time, and version control so I know when the image was captured.

    I add this to the BackupFile variable:

    w8x64_#Replace(FormatDateTime(Now,2),"/","-")#_#Replace(FormatDateTime(Now,4),":","-")#.wim

    It generates a name like w8x64_06-20-13_10-15.wim

    using the vbscript Function FormatDateTme(Now, n) to return date and time variables where Now is the current date and time and n =

    • 2 = vbShortDate - Returns date: mm/dd/yy
    • 4 = vbShortTime - Return time: hh:mm

    FormatDateTime(Now,n) is wrapped in the Replace function. this replaces non valid characters "/" and ":" with "-"

    Replace(string, char to replace, replacement char)

    Wrapping it all in # # tells MDT that its a vbscript function and to evaluate it.

    #Replace(FormatDateTime(Now,2),"/","-")#

    Then I add them all together with a prefix and a .wim extension.

    w8x64_#Replace(FormatDateTime(Now,2),"/","-")#_#Replace(FormatDateTime(Now,4),":","-")#.wim

    Friday, June 21, 2013 3:35 PM