Skip to content

Instantly share code, notes, and snippets.

@chlserver
chlserver / gist:16fe67a9978250e57c6de063fb758b7b
Created February 14, 2020 21:56
Copy Folder and SubFolder Files With Certain File Extension From More Than One Location to %AppData% Variable Path.
Using Vbscript, I am trying to copy files with certain file extensions such as [.tmp, .dat, .txt] from folder and subfolder in more than one location to %AppData% destination user an elevated privillege. Below is the sample of my code that prompts Permission Denined
' Require variables to be defined
Option Explicit
' Global variables
Dim strBaseFolder
Dim strDestFolder
Dim objFSO
Dim objFolder
@chlserver
chlserver / backup script.vbs
Created February 17, 2020 02:38
Simple backup script
runBackup
Function runBackup()
Dim fileName, folderToBackup, fileToBackupTo, currentDate, fileExtensions, eachFileWrite, totalFileWrite
currentDate = DAY(date()) & "." & Month(date()) & "." & YEAR(Date())
fileName = "uTorrent " & currentDate & ".zip" 'File name; leave everything from the first "&" onwards
folderToBackup = "C:\Users\mlevit\AppData\Roaming\uTorrent" ' Location you wish to backup
fileExtensions = array("dat", "old") 'Specify which extensions you wish to backup on (i.e. leave as "array()" if you want the entire folder)