Here is my script that works on Windows XP etc but on windows 7 it does not copy the files only deletes the folder in the temp area.
SessionBackup.vbs - Working
VSB 1 is the backup and works on Windows7 saves to the following path:
C:\Users\Simon\AppData\Local\Temp\tempkcs
Code:set oFSO=createobject("scripting.filesystemobject") set oShell=createobject("wscript.shell") Dim objFSO, objFiles, objShell, intCount Dim strFile, strName, strLongName, strDirectory, strEnv, strExt Set objShell = CreateObject("Wscript.Shell") strEnv = objShell.ExpandEnvironmentStrings("%temp%") intcount = 0 on error resume next sFile=oShell.regread("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\IbsFont") on error goto 0 if sFile="" then else set oFile=ofso.getfile(sFile) sfolder=oFile.parentfolder & "\session" ofso.copyfolder sFolder , strEnv & "\tempkcs" , true end if
Ok Script 2 - Not working on Windows 7 (only deletes the folder)
Code:set oFSO=createobject("scripting.filesystemobject") set oShell=createobject("wscript.shell") Dim objFSO, objFiles, objShell, intCount Dim strFile, strName, strLongName, strDirectory, strEnv, strExt Set objShell = CreateObject("Wscript.Shell") strEnv = objShell.ExpandEnvironmentStrings("%temp%") intcount = 0 on error resume next sFile=oShell.regread("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\IbsFont") on error goto 0 if sFile="" then ' DO NOTHING else ' Copy files from source to destination set oFile=ofso.getfile(sFile) sfolder=oFile.parentfolder ofso.copyfolder strEnv & "\tempkcs" , sFolder & "\session", true ofso.copyfolder strEnv & "\tempkcs" , sFolder & "\KCS\Session605", true oFSO.DeleteFolder strEnv & "\tempkcs", True end if
Hope you can help


LinkBack URL
About LinkBacks




