Board logo

标题: 不改变卷标名称格式化的批处理!(完美支持特殊符号) [打印本页]

作者: different     时间: 2008-12-23 20:56    标题: 不改变卷标名称格式化的批处理!(完美支持特殊符号)

	::by different
	::for 简体winXP
	::如用在英文版的XP要稍改一下代码
	@echo off 

	set drive=w
	echo 驱动器%drive%上的所有数据将会被清除!!!
	pause	
	:nov
	for /f "eol=卷 tokens=*" %%a in ('vol %drive%:') do set check'=%%a
	set check=%check':~-1%
	if "%check%"=="。"  (format %drive%: /y)   else goto hasv
	goto end

	:hasv
	for /f "eol=卷 tokens=*" %%b in ('vol %drive%:')  do echo %%b>h_temp.txt
	for /f "tokens=3* delims= " %%c in (h_temp.txt) do (
	if "%%c"=="中的卷是" echo %%d>h_temp.txt
	)
	format %drive%: /y & label %drive%:<h_temp.txt 2>nul && del h_temp.txt
	
	:end
	pause
格式化前要先卸下要格式的分区。 如用在英文版的XP,要稍改一下代码! 支持%&^*!等特殊符号。 [ Last edited by different on 2008-12-23 at 21:29 ]