中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 05:03
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Question about deleting a startup item with a batch file
Printable Version  1,206 / 4
Floor1 skycn123 Posted 2009-01-18 11:41
新手上路 Posts 2 Credits 8

————————————————————————————————
Moved from DOS Troubleshooting & Problem Discussion (Answer Room)
Obviously posted in the wrong section. Since this is a new forum user, no penalty will be given for now. Please pay attention in the future.
—Administrator
————————————————————————————————




@echo off
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Ravtary
This is a batch file I wrote myself, but when it runs, I have to press Y before it will execute. I want it to run automatically, without needing to press Y.
Please, experts, help me~~~~~~~~
Floor2 BaseCoder Posted 2009-01-18 15:32
初级用户 Posts 13 Credits 20
Floor3 HAT Posted 2009-01-18 15:36
版主 Posts 5,017 Credits 9,023
Read the help more
C:\Test>reg delete /?

Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved


REG DELETE KeyName

KeyName FullKey
Machine Name of remote machine - omitting defaults to the current machine
Only HKLM and HKU are available on remote machines
FullKey ROOTKEY\SubKey
ROOTKEY
SubKey The full name of a registry key under the selected ROOTKEY
ValueName The value name, under the selected Key, to delete
When omitted, all subkeys and values under the Key are deleted
/ve delete the value of empty value name <no name>
/va delete all values under this key
/f Forces the deletion without propmt

Examples:

REG DELETE HKLM\Software\MyCo\MyApp\Timeout
Deletes the registry key Timeout and its all subkeys and values

REG DELETE \\ZODIAC\HKLM\Software\MyCo /v MTU
Deletes the registry value MTU under MyCo on ZODIAC
Floor4 jieorlin Posted 2009-06-08 13:03
新手上路 Posts 2 Credits 2
Yeah, check the help first!
Floor5 Hanyeguxing Posted 2009-06-09 03:31
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
/f means no confirmation is needed, >nul suppresses the "The operation completed successfully" output. 2>nul suppresses error output if the key value cannot be deleted or does not exist.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023