|
本帖最后由 rui-rui 于 2023-8-27 14:44 编辑
我是这样改的:
:: 隐藏G盘
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
mountvol G: /d
恢复是这样:
@echo off
:: 恢复G盘
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
setlocal ENABLEDELAYEDEXPANSION
set n=0
for /f "delims=" %%c in ('
^(
for %%r in ^(
"select volume 2"
"assign letter=G"
^) do @^(
echo %%~r
^)
^)^|diskpart
') do (
if "%%c"=="DISKPART> " (
set /a n+=1
echo.
echo.
echo **** 第 !n! 条 DISKPART 指令 *************************
echo.
) else (
if !n! geq 1 echo %%c
)
)
set /a n-=1
echo 共运行了 !n! 条指令.
exit
几条命令解决。
|
|