Board logo

标题: [系统相关] 如何通过BAT脚本实现桌面右键/刷新? [打印本页]

作者: liht1634    时间: 2021-7-31 16:25     标题: 如何通过BAT脚本实现桌面右键/刷新?

如题,谢谢!
作者: Batcher    时间: 2021-7-31 16:47

回复 1# liht1634


    什么系统?刷新桌面的目的是什么?
作者: yakeyun    时间: 2021-7-31 18:40

本帖最后由 yakeyun 于 2021-7-31 19:08 编辑

回复 1# liht1634


(TASKKILL /F /IM explorer.exe >nul 2>&1) && (explorer.exe)


或者用下面这个:

@echo off
Echo,CreateObject^("WScript.Shell"^).SendKeys "{F5}" >.\F5.vbs
start /w "" "%APPDATA%\Microsoft\Internet Explorer\Quick Launch\Shows Desktop.lnk"
Start /w "" ".\F5.vbs"
Del /q ".\F5.vbs"
exit
作者: cmd1152    时间: 2021-8-1 14:01

非常简单:
  1. ASSOC .tmp=tmpfile
复制代码

作者: lforl    时间: 2024-6-4 11:11

非常简单:
cmd1152 发表于 2021-8-1 14:01



赞!加了这句果然有刷新作用!简洁!
作者: 十三姨    时间: 2024-6-4 11:22

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\RestartExplorer]
"MUIVerb"="重启桌面"
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\
  00,25,00,5c,00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,\
  78,00,65,00,00,00
"Position"="Bottom"
"SubCommands"=""

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\RestartExplorer\shell]

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\RestartExplorer\shell\01RestartExplorer]
"MUIVerb"="重启桌面"
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\
  00,25,00,5c,00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,\
  78,00,65,00,00,00

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\RestartExplorer\shell\01RestartExplorer\Command]
@="cmd.exe /c taskkill /f /im explorer.exe  & start explorer.exe"


以上用软件转成BAT
作者: 十三姨    时间: 2024-6-4 11:25

@ ECHO OFF
rem 关闭Windows外壳程序explorer
taskkill /f /im explorer.exe
rem 启动Windows外壳程序explorer
start explorer.exe
exit




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2