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!
Credits 18 Posts 8 Joined 2007-06-24 11:29 19-year member UID 92223 Gender Male
Status Offline
Just want to modify [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders] 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!
Credits 16 Posts 7 Joined 2007-06-25 08:30 19-year member UID 92274 Gender Male
Status Offline
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 ]