China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-01 00:40
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Please clarify your specific request. Do you want to know how to refresh the desktop in the DOS version? Please provide more details. View 3,399 Replies 17
Original Poster Posted 2007-05-23 20:47 ·  中国 湖北 武汉 武昌区 电信
中级用户
★★
Credits 301
Posts 135
Joined 2007-05-15 16:49
19-year member
UID 88615
Gender Male
Status Offline
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys "{F5}+{F10}e"

This is the VBS version, so I wrote the following
echo Set WSHShell = WScript.CreateObject("WScript.Shell") >temp.vbs
echo WSHShell.SendKeys "{F5}+{F10}e">>temp.vbs
cscript temp.vbs
The above code all executed successfully, but it just can't refresh the desktop. It runs in the background.
Depressed, when I want it to run quietly, it isn't quiet; when I want it not to run quietly, hey, it's surprisingly quiet.
Who can give me a DOS version?

[ Last edited by wert123 on 2007-6-1 at 03:01 PM ]
Floor 2 Posted 2007-05-23 23:34 ·  中国 黑龙江 牡丹江 电信
中级用户
★★
Credits 216
Posts 129
Joined 2007-02-14 07:26
19-year member
UID 79469
Gender Male
Status Offline
Is this thing?
Floor 3 Posted 2007-05-24 13:27 ·  中国 湖北 武汉 武昌区 电信
中级用户
★★
Credits 301
Posts 135
Joined 2007-05-15 16:49
19-year member
UID 88615
Gender Male
Status Offline
taskkill is okay, but the desktop disappears and then appears, which will scare some newbies, thinking it's a virus embedded in explorer.exe. It feels a bit overkill. Can you think of another way for me? Please help everyone think about it.
Floor 4 Posted 2007-05-26 11:56 ·  中国 湖北 武汉 武昌区 电信
中级用户
★★
Credits 301
Posts 135
Joined 2007-05-15 16:49
19-year member
UID 88615
Gender Male
Status Offline
Is the question naive? Why is no one here

[ Last edited by wert123 on 2007-5-30 at 04:38 PM ]
Floor 5 Posted 2007-05-30 16:39 ·  中国 湖北 武汉 电信
中级用户
★★
Credits 301
Posts 135
Joined 2007-05-15 16:49
19-year member
UID 88615
Gender Male
Status Offline
Everyone, please help take a look.
Floor 6 Posted 2007-05-30 20:15 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Try this gpupdate /Force.
Floor 7 Posted 2007-05-30 20:28 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys "{F5}+{F10}e"

Because the focus is not on the desktop, so the F5 key is invalid
你好,脚本专家!
<a target=blank href=tencent://message/?uin=29654761&Site=www.111.com&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=1:29654761:5 alt="点击这里给我发消息"></a>
Floor 8 Posted 2007-05-31 17:23 ·  中国 湖北 武汉 电信
中级用户
★★
Credits 301
Posts 135
Joined 2007-05-15 16:49
19-year member
UID 88615
Gender Male
Status Offline
gpupdate /Force
I checked the help, this command seems to be used to upload interaction policies or something?
I first disabled the display of file extensions, then ran the following code, then ran the above code, the desktop flickered, I was very excited, but the file extensions on my computer still didn't come out, I have to refresh with the right-click menu, so depressed, why is my computer not working? Is it because I was infected with a virus before and something was changed?
@echo off&color f0
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t reg_dword /d 0 /f


[ Last edited by wert123 on 2007-6-2 at 10:48 AM ]
Floor 9 Posted 2007-05-31 17:32 ·  中国 湖北 武汉 电信
中级用户
★★
Credits 301
Posts 135
Joined 2007-05-15 16:49
19-year member
UID 88615
Gender Male
Status Offline
Originally posted by zhoushijay at 2007-5-30 08:28 PM:
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys "{F5}+{F10}e"

Because the focus is not on the desktop, so pressing F5 is invalid

That's very correct, really hits the nail on the head
Can you use DOS to help me get the focus to the desktop? Everyone, come and help me!
Floor 10 Posted 2007-06-01 12:19 ·  中国 江苏 南京 电信
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
First, run the "Show Desktop" in the quick launch bar
Floor 11 Posted 2007-06-01 12:22 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
baomaboy always finds the most effective solution, ^^
你好,脚本专家!
<a target=blank href=tencent://message/?uin=29654761&Site=www.111.com&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=1:29654761:5 alt="点击这里给我发消息"></a>
Floor 12 Posted 2007-06-01 14:59 ·  中国 湖北 武汉 电信
中级用户
★★
Credits 301
Posts 135
Joined 2007-05-15 16:49
19-year member
UID 88615
Gender Male
Status Offline
@echo off&color f0
echo Dim WshSHell,FSO >temp.vbs
echo Set WshSHell = WScript.CreateObject("WScript.Shell") >>temp.vbs
echo Set FSO = CreateObject("Scripting.FileSystemObject") >>temp.vbs
echo scfFileName="zm.scf" >>temp.vbs
echo scfFilePath=fso.GetSpecialFolder(1) >>temp.vbs
echo Set NewFile = FSO.CreateTextFile(FSO.BuildPath(scfFilePath ,scfFileName), True) >>temp.vbs
echo NewFile.WriteLine("") >>temp.vbs
echo NewFile.WriteLine("Command=2") >>temp.vbs
echo NewFile.WriteLine("IconFile=explorer.exe,3") >>temp.vbs
echo NewFile.WriteLine("") >>temp.vbs
echo NewFile.WriteLine("Command=ToggleDesktop") >>temp.vbs
echo NewFile.Close >>temp.vbs
echo wscript.sleep(200) >>temp.vbs
echo wshshell.run "zm.scf" >>temp.vbs
echo wshshell.SendKeys "{F5}+{F10}e">>temp.vbs
echo wscript.sleep(200) >>temp.vbs
echo wscript.quit >>temp.vbs
@temp.vbs

The generated temp.vbs works, but it doesn't work in the DOS version, and the file extension still doesn't show up.
Hey, maybe my computer is really not working right. It seems I have to reinstall the system again.

[ Last edited by wert123 on 2007-6-1 at 03:07 PM ]
Floor 13 Posted 2007-06-01 16:55 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
The default of scf is NeverShowExt. So no matter how you set that to show file extensions, it just doesn't show... Also, to show the desktop can...
Dim objSHA
Set objSHA = CreateObject("Shell.Application")
objSHA.ToggleDesktop
Set objSHA = Nothing
It's okay... theoretically it's just 2 lines...
Floor 14 Posted 2007-06-01 19:16 ·  中国 广东 茂名 电信
初级用户
Credits 42
Posts 23
Joined 2006-02-13 04:23
20-year member
UID 50270
Status Offline
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
my3439955 +2 2007-06-13 15:02
我是allyesno 帐号忘记密码了 妈的
Floor 15 Posted 2007-06-01 22:00 ·  中国 吉林 长春 电信
初级用户
Credits 52
Posts 27
Joined 2006-10-27 16:42
19-year member
UID 68509
Gender Male
Status Offline
Forum Jump: