윈도우2011. 3. 29. 19:07
아래 내용을 backup.vbs 등의 파일로 만들고 실행하면 된다. (VBScript이다.)
폴더가 존재하지 않으면 그냥 넘어간다. (폴더를 알아서 만들어주면 좋겠지만...)
덮어쓰기 전에 물어본다.

백업
set objShell = CreateObject("Shell.Application")
set WshShell = WScript.CreateObject("WScript.Shell")
appdata = WshShell.ExpandEnvironmentStrings("%AppData%\")
userprofile = WshShell.ExpandEnvironmentStrings("%USERPROFILE%\")
current = Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\"))

Function XmanagerBackup(productName)
	Dim srcFolder
	Dim destFolder
	Dim srcFolderItems
	set srcFolder = objShell.NameSpace(appdata & "NetSarang\" & productName & "\Sessions")
	set destFolder = objShell.NameSpace(current & productName)
	if not srcFolder is nothing then
		if not destFolder is nothing then
			set srcFolderItems = srcFolder.Items()
			destFolder.CopyHere(srcFolderItems)
			WScript.Echo "Restore " & productName & " Sessions: Done"
		end if
	else
		WScript.Echo "Restore " & productName & " Sessions: Fail"
	end if
End Function

XmanagerBackup("Xmanager")
XmanagerBackup("Xshell")
XmanagerBackup("Xftp")

리스토어
백업에서 srcFolder, destFolder의 변수명만 바꿔주면 된다. 
set objShell = CreateObject("Shell.Application")
set WshShell = WScript.CreateObject("WScript.Shell")
appdata = WshShell.ExpandEnvironmentStrings("%AppData%\")
userprofile = WshShell.ExpandEnvironmentStrings("%USERPROFILE%\")
current = Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\"))

Function XmanagerRestore(productName)
	Dim srcFolder
	Dim destFolder
	Dim srcFolderItems
	set destFolder = objShell.NameSpace(appdata & "NetSarang\" & productName & "\Sessions")
	set srcFolder = objShell.NameSpace(current & productName)
	if not srcFolder is nothing then
		if not destFolder is nothing then
			set srcFolderItems = srcFolder.Items()
			destFolder.CopyHere(srcFolderItems)
			WScript.Echo "Backup " & productName & " Sessions: Done"
		end if
	else
		WScript.Echo "Backup " & productName & " Sessions: Fail"
	end if
End Function

XmanagerRestore("Xmanager")
XmanagerRestore("Xshell")
XmanagerRestore("Xftp")
이 코드가 제대로 동작한다는 보증은 없다.
Posted by asdfzxcv