11

批处理判断第一个硬盘的最后一个分区并进入

 3 years ago
source link: https://zhang.ge/224.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

批处理判断第一个硬盘的最后一个分区并进入

Jager · 12月20日 · 2013年bat · for · 变量延迟 · 变量拓展 · 批处理 76次已读

参考批处理之家写给百度知友的。→百度问答原址

@echo off
echo 批处理初始工作目录为%cd%,开始切换...
for /f "tokens=3 delims==" %%i in ('Wmic Path Win32_LogicalDiskToPartition^|find /i "Disk #0"') do call :check %%i
echo.
cd /d %B%
echo 工作目录已切换至%cd%,任意键退出...
pause>nul
:check
if not defined A set A=%~1
set B=%~1

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK