Skip to content

Instantly share code, notes, and snippets.

@akpotter
Forked from blaues0cke/add.modify.date.vbs
Created January 7, 2020 10:24
Show Gist options
  • Save akpotter/edbe9cb039e5fd0174f881765c1c2a06 to your computer and use it in GitHub Desktop.
Save akpotter/edbe9cb039e5fd0174f881765c1c2a06 to your computer and use it in GitHub Desktop.
Set fileSystemObject = CreateObject("Scripting.FileSystemObject")
inputFilePathFull = WScript.Arguments(0)
Set fileObject = fileSystemObject.GetFile(inputFilePathFull)
inputFileName = fileSystemObject.GetFileName(fileObject)
inputFilePath = fileSystemObject.GetParentFolderName(fileObject)
outputFilePath = inputFilePath & "\" & Year(fileObject.DateLastModified) & Right("0" & Month(fileObject.DateLastModified), 2) & Right("0" & Day(fileObject.DateLastModified), 2) & " - " & inputFileName
If fileSystemObject.FileExists(inputFilePathFull) Then
fileSystemObject.MoveFile inputFilePathFull, outputFilePath
End If
Set fileSystemObject = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment