VBscript 中 WScript.Shell的使用 设置快捷方式

来源:互联网 发布:刷svip永久软件 编辑:程序博客网 时间:2024/05/18 02:19

Window set up some templates for users to build reality and the WScript.Shell is one of the examples.

it has three personalities and nearly twelve functions.

three personalities 


This is an example. the shell is a reality and its three personalities are CurrentDirectory  | Environment  | SpecialFolders 

CreatShortcut is one of the functions.


'set up shortcut for one fileDim shell,desktopPath,shortLnkset shell=CreateObject("WScript.Shell")desktopPath=shell.SpecialFolders("Desktop")     'the postion of shortcutset shortLnk=shell.CreateShortcut(desktopPath &"\cmd.lnk")   ' set a reality of shortcutshortLnk.TargetPath="C:\Windows\System32\cmd.exe"           ' the shortLnk is the shortcut of cmd.exe shortLnk.WorkingDirectory="C:\Windows\System32"             ' this is where the cmd isshortLnk.Save()                                             ' you need to make the shortLnk become a reality not just in the memory


0 0
原创粉丝点击