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-08-12 00:50
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Question about deleting a startup item with a batch file View 1,204 Replies 4
Original Poster Posted 2009-01-18 11:41 ·  中国 江苏 南通 移动
新手上路
Credits 8
Posts 2
Joined 2009-01-14 13:51
17-year member
UID 136653
Gender Male
Status Offline

————————————————————————————————
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~~~~~~~~
Floor 2 Posted 2009-01-18 15:32 ·  中国 江苏 苏州 电信
初级用户
Credits 20
Posts 13
Joined 2009-01-05 14:58
17-year member
UID 135829
Gender Male
Status Offline
Floor 3 Posted 2009-01-18 15:36 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
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
Floor 4 Posted 2009-06-08 13:03 ·  中国 安徽 合肥 电信
新手上路
Credits 2
Posts 2
Joined 2009-02-27 11:50
17-year member
UID 140124
Gender Male
Status Offline
Yeah, check the help first!
Floor 5 Posted 2009-06-09 03:31 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
/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.
Forum Jump: