Skip to content

Instantly share code, notes, and snippets.

@blaues0cke
Created July 24, 2015 07:33
Show Gist options
  • Save blaues0cke/52f59fa90c0405717750 to your computer and use it in GitHub Desktop.
Save blaues0cke/52f59fa90c0405717750 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