标题: [其他] 固定到"开始"屏幕,怎么写? [打印本页]
作者: zhoubin 时间: 2019-9-26 09:03 标题: 固定到"开始"屏幕,怎么写?
请教坛里的高手,win10下,固定到"开始"屏幕,批处理怎么写!!
谢谢高手!
作者: a20150604 时间: 2019-9-26 10:44
回复 1# zhoubin
参考:
https://4sysops.com/archives/pin ... 7-with-group-policy
powershell xml 导入导出 开始布局
作者: zhoubin 时间: 2019-9-26 11:28
写了一个用NOTEPAD2打开的批处理:- PUSHD %~dp0
- copy NOTEPAD.EXE "%ProgramFiles%"
- cd /d %ProgramFiles%
- reg add "HKLM\SOFTWARE\Classes\*\shell\用Notepad2打开\command" /f /ve /t REG_SZ /d "%cd%\NOTEPAD.EXE %%1"
- @echo off
- for /f "tokens=2 delims=[" %%a in ('ver') do for /f "tokens=2,3 delims=. " %%b in ("%%a") do set Winver=%%b%%c
- @echo on
- IF %winver% GEQ 60 if not "%windir:~,2%"=="X:" set UserPrograms=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
- IF %winver% LSS 60 if not "%windir:~,2%"=="X:" set UserPrograms=%USERPROFILE%\「开始」菜单\程序
- if not "%windir:~,2%"=="X:" mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%UserPrograms%\NOTEPAD.lnk""):b.TargetPath=""%cd%\NOTEPAD.EXE"":b.WorkingDirectory=""%cd%\"":b.Save:close")
- IF %winver% GEQ 60 if not "%windir:~,2%"=="X:" call :StartMenuPin
-
- ::IF %winver% GEQ 60 set UserMenu=%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu
- IF %winver% GEQ 60 set UserMenu=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu
- IF %winver% LSS 60 set UserMenu=%USERPROFILE%\「开始」菜单
- ::if "%windir:~,2%"=="X:" PECMD.EXE LINK %%Programs%%\NOTEPAD,%cd%\NOTEPAD.EXE
- if "%windir:~,2%"=="X:" PECMD.EXE LINK %UserMenu%\NOTEPAD,%cd%\NOTEPAD.EXE
- ::start /b "" "%cd%\NOTEPAD.EXE"
- goto :eof
-
- :StartMenuPin
- echo Sub startpin(lnkfile)>>Win7.vbs
- echo 'Const CSIDL_COMMON_PROGRAMS = ^&H17>>Win7.vbs
- echo Set objShell = CreateObject("Shell.Application")>>Win7.vbs
- echo 'Set objAllUsersProgramsFolder = objShell.NameSpace(CSIDL_COMMON_PROGRAMS)>>Win7.vbs
- echo 'strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path>>Win7.vbs
- echo path=Left(lnkfile,InStrRev(lnkfile,"\"))>>Win7.vbs
- echo Set objFolder = objShell.Namespace(path)>>Win7.vbs
- echo name=Replace(lnkfile,path,"")>>Win7.vbs
- echo Set objFolderItem = objFolder.ParseName(name)>>Win7.vbs
- echo Set colVerbs = objFolderItem.Verbs>>Win7.vbs
- echo For Each objVerb in colVerbs>>Win7.vbs
- echo If Left(objVerb.name,2) = "附到" Then objVerb.DoIt>>Win7.vbs
- echo Next>>Win7.vbs
- echo End Sub>>Win7.vbs
- echo startpin Wscript.Arguments(0)>>Win7.vbs
- ping 127.0.0.1 -n 3 >nul 2>nul
- Win7.vbs "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\NOTEPAD.lnk"
- ping 127.0.0.1 -n 5 >nul 2>nul
- del /q Win7.vbs
- goto :eof
-
- Windows Registry Editor Version 5.00
-
- ;;用记事本打开
- ;[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\用记事本打开\command]
- ;@="notepad.exe %1"
- ;;用Notepad2打开
-
- ;;用Notepad2打开
- [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\用Notepad2打开\command]
- @="D:\\Green Soft\\NOTEPAD.EXE %1"
复制代码
作者: zhoubin 时间: 2019-9-26 11:34
NOTEPAD已上传百度网盘了,需要的朋友,去下载吧!
链接:https://pan.baidu.com/s/1PccEY-DRufuaGouugkYXVw
提取码:80b8
作者: zhoubin 时间: 2019-9-26 11:40
win10下,想把%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\NOTEPAD.lnk固定到"开始"屏幕,批处理不会写,感谢2楼的朋友提供的资料,看了一下,有点复杂,那位朋友帮我写一下:固定到"开始"屏幕的批处理呗,谢谢了!!
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |