Skip to content

Instantly share code, notes, and snippets.

@blaues0cke
Created July 24, 2015 07:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save blaues0cke/de3ee8ad9e48de7a137a 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(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 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