找回密码
 加入
搜索
查看: 1279|回复: 17

[网络通信] 【已解决】explorer.exe结束再运行问题

[复制链接]
发表于 2022-7-21 14:54:43 | 显示全部楼层 |阅读模式
本帖最后由 13gu 于 2022-7-24 20:45 编辑

https://www.autoitx.com/forum.ph ... hlight=explorer.exe


按这贴子三楼的代码

ProcessWait ( "explorer.exe" )
Run(@ComSpec & " /c " & 'taskkill /f /im explorer.exe ', "", @SW_HIDE)
Sleep(2000)
ShellExecute('explorer.exe')
Exit


还是会弹出库的窗口出来。也没有正常显示桌面。


同时在结束explorer.exe期间,在桌面中间显示一行文字又要怎么加呢?
发表于 2022-7-21 15:39:54 | 显示全部楼层
SplashTextOn("温馨提示", "这是你要显示的内容", -1, 55, -1, -1, 4, "", 24)
Sleep(1000)
SplashOff()
发表于 2022-7-21 16:22:10 | 显示全部楼层
ProcessClose("explorer.exe")
ToolTip("正在重启桌面进程!", @DesktopWidth / 2, @DesktopHeight / 2)
Sleep(3000)
If Not ProcessExists("explorer.exe") Then
        Run(@WindowsDir & "\explorer.exe")
EndIf
ToolTip("")
 楼主| 发表于 2022-7-21 16:59:31 | 显示全部楼层
 楼主| 发表于 2022-7-21 17:02:23 | 显示全部楼层

ProcessClose("explorer.exe")
ToolTip("正在重启桌面进程!", @DesktopWidth / 2, @DesktopHeight / 2)
Sleep(3000)
你好,我只运行上面的,不能关闭explorer.exe吧
只相当于刷新桌面。
发表于 2022-7-21 17:07:04 | 显示全部楼层
13gu 发表于 2022-7-21 17:02
ProcessClose("explorer.exe")
ToolTip("正在重启桌面进程!", @DesktopWidth / 2, @DesktopHeight / 2) ...

ProcessClose 就是关闭进程的
你关掉还得再打开啊,不然没有桌面额
你自己测试一下就知道了。
 楼主| 发表于 2022-7-21 21:09:30 | 显示全部楼层
wanhua8u8 发表于 2022-7-21 17:07
ProcessClose 就是关闭进程的
你关掉还得再打开啊,不然没有桌面额
你自己测试一下就知道了。

我的目的是关闭期间,有中文提示,
时间放长点。
要打开时再运行 explorer.exe
发表于 2022-7-23 00:11:54 | 显示全部楼层
上面的代码,适当修改几个字符就可以了的。
 楼主| 发表于 2022-7-23 07:55:36 | 显示全部楼层
漠北雪~狼 发表于 2022-7-23 00:11
上面的代码,适当修改几个字符就可以了的。

请问怎么修改呢,能不能修改好发出来呢,谢谢
发表于 2022-7-23 12:23:47 | 显示全部楼层
Run(@ComSpec & ' /c taskkill /f /im explorer.exe', '', @SW_HIDE)
SplashTextOn('温馨提示', '正在结束 explorer 请稍候…', 300, 50)
Do
        Sleep(500)
Until Not ProcessExists('explorer.exe')
SplashOff()
ShellExecute('explorer.exe')
Exit
 楼主| 发表于 2022-7-23 17:41:34 | 显示全部楼层

老大,你试了么,我运行后会弹库文件夹,同时不会再运行explorer.exe
发表于 2022-7-23 17:57:43 | 显示全部楼层
13gu 发表于 2022-7-23 17:41
老大,你试了么,我运行后会弹库文件夹,同时不会再运行explorer.exe

试过正常
你可以加 #RequireAdmin 再试
 楼主| 发表于 2022-7-23 21:11:34 | 显示全部楼层
afan 发表于 2022-7-23 17:57
试过正常
你可以加 #RequireAdmin 再试

我用的是WIN7系统,加了#RequireAdmin还是一样
发表于 2022-7-23 21:39:40 | 显示全部楼层
SplashTextOn('温馨提示', '正在结束 explorer 请稍候…', 300, 50)
Do
        ProcessClose('explorer.exe')
        Sleep(100)
Until Not ProcessExists('explorer.exe')
SplashOff()
ShellExecute('explorer.exe')
Exit

自己的问题自己要多码代码试,别这么手一伸或者手一摊
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-27 17:48 , Processed in 0.075617 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表