移動(dòng)快捷方式需要用到文件系統(tǒng)對象 (FSO)。下面的腳本將演示如何使用文件系統(tǒng)對象來移動(dòng)快捷方式。
// JScript。 Shell = new ActiveXObject("WScript.Shell"); FSO = new ActiveXObject("Scripting.FileSystemObject"); DesktopPath = Shell.SpecialFolders("Desktop") + "\\test.lnk"; MyDocumentsPath = Shell.SpecialFolders("MyDocuments") + "\\test.lnk"; FSO.MoveFile(DesktopPath,MyDocumentsPath); ' VBScript。 Set Shell = CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") DesktopPath = Shell.SpecialFolders("Desktop") & "\test.lnk" MyDocumentsPath = Shell.SpecialFolders("MyDocuments") & "\test.lnk" FSO.MoveFile DesktopPath,MyDocumentsPath