[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[其他] 固定到"开始"屏幕,怎么写?

请教坛里的高手,win10下,固定到"开始"屏幕,批处理怎么写!!
谢谢高手!

回复 1# zhoubin

参考:
https://4sysops.com/archives/pin ... 7-with-group-policy

powershell xml 导入导出 开始布局

TOP

写了一个用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"
复制代码

TOP

NOTEPAD已上传百度网盘了,需要的朋友,去下载吧!
链接:https://pan.baidu.com/s/1PccEY-DRufuaGouugkYXVw
提取码:80b8

TOP

win10下,想把%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\NOTEPAD.lnk固定到"开始"屏幕,批处理不会写,感谢2楼的朋友提供的资料,看了一下,有点复杂,那位朋友帮我写一下:固定到"开始"屏幕的批处理呗,谢谢了!!

TOP

返回列表