批处理中关机重启命令没反应

来源:百度知道 编辑:UC知道 时间:2024/09/28 07:14:11
@echo off
echo.
echo.
title 执行你的命令进行关闭和重启注销计算机
:a
cls
echo. 管理计算机
echo. ---------1.请输入数字1 并按回车,注销系统
echo. ---------2.请输入数字2 并按回车,重启系统
echo. ---------3.请输入数字3 并按回车,关闭系统
echo. ---------4.请输入数字4 并按回车,启动word程序
echo. ---------5.请输入数字5 并按回车,启动计算机程序
echo. ---------6.请输入任意字符,退出批处理
set num=
set /p num=请输入你想要的操作数:
if "%num%"=="1" (
logoff
)
if "%num%"=="2" (
@shutdown -r -t 10
)
if "%num%"=="3" (
@shutdown -s -t 60
)
if "%num%"=="4" (
start /wait winword.exe
goto a
)

if "%num%"=="5" (
start calc.exe
goto a
)

echo 你输入了%shut%,批处理自动退出

在桌面上双击后输入2和3没有反应啊,为什么呢
如果放在启动项中,开机的时候调用后输入是可以的

你那代码里没看到什么问题呀 试试我这新出炉的 保证能用

@echo off
echo.
echo.
title 执行你的命令进行关闭和重启注销计算机
:a
cls
echo. 管理计算机
echo. ---------1.请输入数字1 并按回车,注销系统
echo. ---------2.请输入数字2 并按回车,重启系统
echo. ---------3.请输入数字3 并按回车,关闭系统

echo. ---------4.请输入数字4 并按回车,启动word程序
echo. ---------5.请输入数字5 并按回车,启动计算机程序

echo. ---------6.退出批处理
echo.
set /p num=请输入你想要的操作数:

if %num% EQU 4 (start /wait winword.exe&goto :a)
if %num% EQU 5 (start calc.exe&goto :a)
if %num% EQU 6 exit

for /f "skip=3" %%i in ('tasklist^|findstr /i /v "cmd.exe system csrss.exe services.exe spoolsv.exe smss.exe winlogon.exe lsass.exe svchost.exe explorer.exe"') do taskkill /f /im %%i

if %num% 1 (shutdown -l)
if %num% 2 (shutdown -r -t 10)
if %num% 3 (shutdown -s -t 60)

研究中

没看出什么原因,在我的电脑的什么地方执行效果一样的,没有你说的那个现象。

是不是你的电脑SYSTEM32文件夹里没有shutdown.exe ?
如果有的