|
coolclack
新手上路

积分 18
发帖 8
注册 2007-6-24
状态 离线
|
『楼 主』:
如何让使用批处理添加reg的键值????
使用 LLM 解释/回答一下
只想修改[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
里的 desktop 为 d:\123 原来是%...%桌面
试了哈下面的
@Echo off
regedit /s regfile.reg
taskkill /im explorer.exe /f
explorer.exe
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
exit
需要要先有reg文件 才能用 regedit /s 导入 才能添加吗??
能不能直接用1个bat 把注册表键值添加了
运行taskkill /im explorer.exe /f 能不能不让任务栏消失 也能刷新桌面?
我用的bat最后为什么dos窗口还没有关闭
如果能用vbs实现哪更好拉!!!
Just want to modify The desktop inside is changed to d:\123, which was originally %...% desktop.
I tried the following:
@Echo off
regedit /s regfile.reg
taskkill /im explorer.exe /f
explorer.exe
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
exit
Do I need to have a reg file first to use regedit /s to import and then add? Can I directly use one bat to add the registry key value?
Can running taskkill /im explorer.exe /f not make the taskbar disappear and also refresh the desktop?
Why does the dos window not close at the end of my bat?
It would be better if it can be realized with vbs!
|
|
2007-6-26 01:10 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
修改注册表可以用 reg 命令。
Modifying the registry can use the reg command.
|
|
2007-6-26 02:52 |
|
|
recooliu
新手上路

积分 16
发帖 7
注册 2007-6-25
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
使用REG ADD命令可以做到~~~~
Windows 控制台注册表工具 - 版权所有 (C) Microsoft Corp. 1981-2001. 保留所有权繰EG ADD KeyName
KeyName FullKey
远程机器的机器名 - 忽略默认到当前机器。
远程机器上只有 HKLM 和 HKU。
FullKey ROOTKEY\SubKey
ROOTKEY
SubKey 所选 ROOTKEY 下注册表项的完整名
/v 所选项之下要添加的值名
/ve 为注册表项添加空白值名<无名称>
/t RegKey 数据类型
如果忽略,则采用 REG_SZ
/s 指定一个在 REG_MULTI_SZ 数据字符串中
用作分隔符的字符
如果忽略,则将 "\0" 用作分隔符
/d 要分配给添加的注册表 ValueName 的数据
/f 不用提示就强行改写现有注册表项
例如:
REG ADD \\ABC\HKLM\Software\MyCo
添加远程机器 ABC 上的一个注册表项 HKLM\Software\MyCo
REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead
添加一个值(名称: Data,类型: REG_BINARY,数据: fe340ead)
REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail
添加一个值(名称: MRU,类型: REG_MUTLI_SZ,数据: fax\0
Last edited by recooliu on 2007-6-26 at 09:04 AM ]
Using the REG ADD command can do~~~~
Windows Console Registry Tool - Copyright (C) Microsoft Corp. 1981-2001. All rights reserved.REG ADD KeyName
KeyName FullKey
Machine name of a remote machine - ignored defaults to current machine.
Only HKLM and HKU on remote machines.
FullKey ROOTKEY\SubKey
ROOTKEY
SubKey The full name of the registry key under the selected ROOTKEY
/v The name of the value to add under the specified key
/ve Adds a blank value name <No Name> to the registry key
/t RegKey data type
If omitted, REG_SZ is used
/s Specifies a character to use as a separator in REG_MULTI_SZ data strings
If omitted, "\0" is used as the separator
/d The data to assign to the added registry ValueName
/f Forcefully overwrite an existing registry key without prompting
For example:
REG ADD \\ABC\HKLM\Software\MyCo
Adds a registry key HKLM\Software\MyCo on remote machine ABC
REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead
Adds a value (name: Data, type: REG_BINARY, data: fe340ead)
REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail
Adds a value (name: MRU, type: REG_MUTLI_SZ, data: fax\0
Last edited by recooliu on 2007-6-26 at 09:04 AM ]
|

QQ增值服务---8元/月/项
可查时间
可续费
不加好友 |
|
2007-6-26 08:56 |
|
|
coolclack
新手上路

积分 18
发帖 8
注册 2007-6-24
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
楼上的太复杂了
能说的具体点吗?
The complexity upstairs is too high. Can you be more specific?
|
|
2007-6-26 09:29 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
添加一个开机自启动项
@echo off
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v MyAutoRun /t REG_SZ /d C:/test.bat /f
Add a boot - up self - starting item
@echo off
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v MyAutoRun /t REG_SZ /d C:/test.bat /f
|
|
2007-6-26 10:47 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
具体到你的问题
@echo off
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d d:\123 /f
Specific to your question
@echo off
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d d:\123 /f
|
|
2007-6-26 10:51 |
|
|
coolclack
新手上路

积分 18
发帖 8
注册 2007-6-24
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
网吧的机器 你叫我要一台一台的添吗??
Do you mean I have to add them one by one to the machines in the internet café?
|
|
2007-6-26 18:52 |
|
|
terse
银牌会员
    
积分 2404
发帖 946
注册 2005-9-8
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
For /f "delims=" %%i in (远程机器.txt) do (
REG ADD \\%%i\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d d:\123 /f
)
无法测试 :(
For /f "delims=" %%i in (Remote Machine.txt) do (
REG ADD \\%%i\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d d:\123 /f
)
Unable to test :(
|
|
2007-6-26 19:09 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
//网吧的机器 你叫我要一台一台的添吗??
在1楼不说清楚 你叫大家一个一个的猜吗??
^_^
//The machines in the internet café, do you want me to add them one by one??
Not making it clear on the first floor, do you want everyone to guess one by one??
^_^
|
|
2007-6-26 19:11 |
|
|
coolclack
新手上路

积分 18
发帖 8
注册 2007-6-24
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
添加成了 后面2个问题呢?
Last edited by coolclack on 2007-6-26 at 08:24 PM ]
What about the last two questions?
Last edited by coolclack on 2007-6-26 at 08:24 PM ]
|
|
2007-6-26 20:21 |
|
|
dikex
高级用户
    潜水修练批处理
积分 788
发帖 366
注册 2006-12-31
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
运行taskkill /im explorer.exe /f 能不能不让任务栏消失 也能刷新桌面?
不能
我用的bat最后为什么dos窗口还没有关闭
直接调用其他命令时会等待其他命令的结束才进行下一个命令的,
@Echo off
regedit /s regfile.reg
taskkill /im explorer.exe /f
start "" explorer.exe
start "" RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
exit
Can running taskkill /im explorer.exe /f prevent the taskbar from disappearing and still refresh the desktop?
No.
Why does the DOS window not close at the end of my bat?
When directly calling other commands, it will wait for the end of other commands before proceeding to the next command.
@Echo off
regedit /s regfile.reg
taskkill /im explorer.exe /f
start "" explorer.exe
start "" RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
exit
|

正在潜水修练的批处理小白 |
|
2007-6-26 20:30 |
|
|
coolclack
新手上路

积分 18
发帖 8
注册 2007-6-24
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
@echo off
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d D:\123 /f
taskkill /im explorer.exe /f
start "" explorer.exe
start "" RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
exit
应该没问题了吧?? 楼上的?!
@echo off
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d D:\123 /f
taskkill /im explorer.exe /f
start "" explorer.exe
start "" RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
exit
Is it okay now?? Upstairs?!
|
|
2007-6-26 20:33 |
|
|
coolclack
新手上路

积分 18
发帖 8
注册 2007-6-24
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
@echo off
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d C:\Documents and settings\Administrator\桌面 /f
taskkill /im explorer.exe /f
start "" explorer.exe
start "" RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
exit
哎呀!刷不会原来的桌面了
什么命令行参数太多?
@echo off
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d C:\Documents and settings\Administrator\桌面 /f
taskkill /im explorer.exe /f
start "" explorer.exe
start "" RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
exit
Oh! Can't brush back to the original desktop
What is too many command line parameters?
|
|
2007-6-26 20:37 |
|
|
lasting
初级用户
 
积分 52
发帖 24
注册 2007-5-9
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
刷新桌面不防用以下命令。。。‘
ntsd -c q -pn explorer.exe
Refreshing the desktop might as well use the following command...
ntsd -c q -pn explorer.exe
|
|
2007-6-26 22:09 |
|
|
terse
银牌会员
    
积分 2404
发帖 946
注册 2005-9-8
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
试一下VBS:
path="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\"
set ws=wscript.createobject("wscript.shell")
t=ws.regwrite(path & "Desktop","D:\123")
ws.run "ntsd -c q -pn explorer.exe"
Last edited by terse on 2007-6-27 at 11:58 PM ]
Try VBS:
path="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\"
set ws=wscript.createobject("wscript.shell")
t=ws.regwrite(path & "Desktop","D:\123")
ws.run "ntsd -c q -pn explorer.exe"
Last edited by terse on 2007-6-27 at 11:58 PM ]
|
|
2007-6-26 22:19 |
|