Google Code Prettify - 輕量級的語法上色工具

星期日, 9月 18, 2022

Desktop Create Shortcut

On Error Resume Next 

Set oShell = CreateObject("WScript.Shell")

Set oFSO = CreateObject("Scripting.FileSystemObject")

sDesktop = oShell.SpecialFolders("Desktop")


sPath = "\\twhc-srv-fs1\share"

Set oCut = oShell.CreateShortcut(sDesktop + "\Share (位於 twhc-srv-fs1).lnk")

oCut.TargetPath = sPath

oCut.Arguments = ""

oCut.Save


sPath = "\\twhc-srv-fs1\dept"

Set oCut = oShell.CreateShortcut(sDesktop + "\Dept (位於 twhc-srv-fs1).lnk")

oCut.TargetPath = sPath

oCut.Arguments = ""

oCut.Save


OsType = oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")


If OsType = "x86" then

'wscript.echo "Windows 32bit system detected"


sPath = "%SYSTEMROOT%\system32\rcimlby.exe"

Set oCut = oShell.CreateShortcut(sDesktop + "\遠端協助.lnk")

oCut.TargetPath = sPath

oCut.Arguments = "-LaunchRA"

oCut.Save


elseif OsType = "AMD64" then

'wscript.echo "Windows 64bit system detected"


sPath = "%windir%\system32\msra.exe"

Set oCut = oShell.CreateShortcut(sDesktop + "\遠端協助.lnk")

oCut.TargetPath = sPath

oCut.Arguments = ""

oCut.Save


end if