复制代码
- PowerShell "$oShell=New-Object -com Shell.Application;$oShell.NameSpace('%~dp0').ParseName('xxx.Lnk').Verbs()|?{$_.Name -match '^附到'}|forEach{$_.DoIt()}"
复制代码
- @echo off
- ———————————————————————————
- cls
- ——————————————————————————————————————————————————
- del /q 0000-win7.vbs
- ::创建exe文件的lnk快捷方式
- ::win7系统下,在开始菜单的附件accessories下面,建立快捷方式
- @echo off
- set "SrcFile=%SystemRoot%\system32\shutdown.exe"
- set "Args=-s -t 2"
- set "LnkFile=关机.LNK"
- call :CreateShort "%SrcFile%" "%Args%" "%LnkFile%" "%IconPath%"
- pause & goto :eof
- ::Arguments 目标程序参数
- ::Description 快捷方式备注
- ::FullName 返回快捷方式完整路径
- ::Hotkey 快捷方式快捷键
- ::IconLocation 快捷方式图标,不设则使用默认图标
- ::TargetPath 目标
- ::WindowStyle 窗口启动状态
- ::WorkingDirectory 起始位置
- :CreateShort
- mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""startmenu"") & ""\\Programs\accessories\%~3""):b.TargetPath=""%~1"":b.WorkingDirectory=""%~dp1"":b.Arguments=""%~2"":b.IconLocation=""%windir%\system32\shell32.dll,27"":b.Save:close")
- ::创建exe文件的lnk快捷方式
- ::win7系统下,在开始菜单的附件accessories下面,建立快捷方式
- set SrcFile=logoff
- set LnkFile=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\注销
- call :CreateShort "%SrcFile%" "%LnkFile%" "%IconPath%"
- goto :eof
- ::Arguments 目标程序参数
- ::Description 快捷方式备注
- ::FullName 返回快捷方式完整路径
- ::Hotkey 快捷方式快捷键
- ::IconLocation 快捷方式图标,不设则使用默认图标
- ::TargetPath 目标
- ::WindowStyle 窗口启动状态
- ::WorkingDirectory 起始位置
- :CreateShort
- mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~2.lnk""):b.TargetPath=""%~1"":b.WorkingDirectory=""C:\windows\system32\"":b.IconLocation=""%windir%\system32\shell32.dll,44"":b.Save:close")
- set "profils=C:\Program Files"
- if exist "C:\Program Files (x86)" set "profils=C:\Program Files (x86)"
- ::创建exe文件的lnk快捷方式
- ::win7系统下,在开始菜单的附件accessories下面,建立快捷方式
- set SrcFile=%profils%\Internet Explorer\iexplore.exe
- set LnkFile=%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer
- call :CreateShort "%SrcFile%" "%LnkFile%"
- goto :eof
- ::Arguments 目标程序参数
- ::Description 快捷方式备注
- ::FullName 返回快捷方式完整路径
- ::Hotkey 快捷方式快捷键
- ::IconLocation 快捷方式图标,不设则使用默认图标
- ::TargetPath 目标
- ::WindowStyle 窗口启动状态
- ::WorkingDirectory 起始位置
- :CreateShort
- mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~2.lnk""):b.TargetPath=""%~1"":b.WorkingDirectory=""%~dp1"":b.Save:close")
- echo Sub startpin(lnkfile)>>0000-win7.vbs
- echo 'Const CSIDL_COMMON_PROGRAMS = ^&H17>>0000-win7.vbs
- echo Set objShell = CreateObject("Shell.Application")>>0000-win7.vbs
- echo 'Set objAllUsersProgramsFolder = objShell.NameSpace(CSIDL_COMMON_PROGRAMS)>>0000-win7.vbs
- echo 'strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path>>0000-win7.vbs
- echo path=Left(lnkfile,InStrRev(lnkfile,"\"))>>0000-win7.vbs
- echo Set objFolder = objShell.Namespace(path)>>0000-win7.vbs
- echo name=Replace(lnkfile,path,"")>>0000-win7.vbs
- echo Set objFolderItem = objFolder.ParseName(name)>>0000-win7.vbs
- echo Set colVerbs = objFolderItem.Verbs>>0000-win7.vbs
- echo For Each objVerb in colVerbs>>0000-win7.vbs
- echo If Left(objVerb.name,2) = "附到" Then objVerb.DoIt>>0000-win7.vbs
- echo Next>>0000-win7.vbs
- echo End Sub>>0000-win7.vbs
- echo startpin Wscript.Arguments(0)>>0000-win7.vbs
- ping 127.0.0.1 -n 3 >nul 2>nul
- ren "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\Paint.lnk" 画图.lnk
- ren "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\Calculator.lnk" 计算器.lnk
- ren "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\System Tools\Resource Monitor.lnk" 资源监视器.lnk
- ren "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\关机.lnk"
- ren "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\Snipping Tool.lnk" 截图.lnk
- ren "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Notepad.lnk" 记事本.lnk
- ren "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Command Prompt.lnk" 命令提示符.lnk
- ren "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\注销.lnk"
- 0000-win7.vbs "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\画图.lnk"
- 0000-win7.vbs "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\计算器.lnk"
- 0000-win7.vbs "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\System Tools\资源监视器.lnk"
- 0000-win7.vbs "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\关机.lnk"
- 0000-win7.vbs "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\截图.lnk"
- 0000-win7.vbs "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\记事本.lnk"
- 0000-win7.vbs "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\命令提示符.lnk"
- 0000-win7.vbs "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\accessories\注销.lnk"
- 0000-win7.vbs "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk"
- ping 127.0.0.1 -n 5 >nul 2>nul
- del /q 0000-win7.vbs
- ——————————————————————————————————————————————————
- ——————————————————————————————————————————————————
- exit
欢迎光临 批处理之家 (http://www.bathome.net/) | Powered by Discuz! 7.2 |