Board logo

标题: [其他] 固定到"开始"屏幕,怎么写? [打印本页]

作者: 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打开的批处理:
  1. PUSHD %~dp0
  2. copy NOTEPAD.EXE "%ProgramFiles%"
  3. cd /d %ProgramFiles%
  4. reg add "HKLM\SOFTWARE\Classes\*\shell\用Notepad2打开\command" /f /ve /t REG_SZ /d "%cd%\NOTEPAD.EXE %%1"
  5. @echo off
  6. for /f "tokens=2 delims=[" %%a in ('ver') do for /f "tokens=2,3 delims=. " %%b in ("%%a") do set Winver=%%b%%c
  7. @echo on
  8. IF %winver% GEQ 60 if not "%windir:~,2%"=="X:" set UserPrograms=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
  9. IF %winver% LSS 60 if not "%windir:~,2%"=="X:" set UserPrograms=%USERPROFILE%\「开始」菜单\程序
  10. 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")
  11. IF %winver% GEQ 60 if not "%windir:~,2%"=="X:" call :StartMenuPin
  12. ::IF %winver% GEQ 60 set UserMenu=%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu
  13. IF %winver% GEQ 60 set UserMenu=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu
  14. IF %winver% LSS 60 set UserMenu=%USERPROFILE%\「开始」菜单
  15. ::if "%windir:~,2%"=="X:" PECMD.EXE LINK %%Programs%%\NOTEPAD,%cd%\NOTEPAD.EXE
  16. if "%windir:~,2%"=="X:" PECMD.EXE LINK %UserMenu%\NOTEPAD,%cd%\NOTEPAD.EXE
  17. ::start /b "" "%cd%\NOTEPAD.EXE"
  18. goto :eof
  19. :StartMenuPin
  20. echo Sub startpin(lnkfile)>>Win7.vbs
  21. echo 'Const CSIDL_COMMON_PROGRAMS = ^&H17>>Win7.vbs
  22. echo Set objShell = CreateObject("Shell.Application")>>Win7.vbs
  23. echo 'Set objAllUsersProgramsFolder = objShell.NameSpace(CSIDL_COMMON_PROGRAMS)>>Win7.vbs
  24. echo 'strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path>>Win7.vbs
  25. echo path=Left(lnkfile,InStrRev(lnkfile,"\"))>>Win7.vbs
  26. echo Set objFolder = objShell.Namespace(path)>>Win7.vbs
  27. echo name=Replace(lnkfile,path,"")>>Win7.vbs
  28. echo Set objFolderItem = objFolder.ParseName(name)>>Win7.vbs
  29. echo Set colVerbs = objFolderItem.Verbs>>Win7.vbs
  30. echo For Each objVerb in colVerbs>>Win7.vbs
  31. echo     If Left(objVerb.name,2) = "附到" Then objVerb.DoIt>>Win7.vbs
  32. echo Next>>Win7.vbs
  33. echo End Sub>>Win7.vbs
  34. echo startpin Wscript.Arguments(0)>>Win7.vbs
  35. ping 127.0.0.1 -n 3 >nul 2>nul
  36. Win7.vbs "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\NOTEPAD.lnk"
  37. ping 127.0.0.1 -n 5 >nul 2>nul
  38. del /q Win7.vbs
  39. goto :eof
  40. Windows Registry Editor Version 5.00
  41. ;;用记事本打开
  42. ;[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\用记事本打开\command]
  43. ;@="notepad.exe %1"
  44. ;;用Notepad2打开
  45. ;;用Notepad2打开
  46. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\用Notepad2打开\command]
  47. @="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