楼 主
请教 在每行插入
发表于 2007-03-24 11:27 · 中国 福建 三明 电信
新手上路
★
积分 18
发帖 7
注册 2006-12-20 00:26
19年会员
UID 73981
性别 男
状态 离线
如何用批处理实现将一段文字插入另一个批处理每一段命令的头或尾
谢谢~~~
第 2 楼
发表于 2007-03-24 11:28 · 中国 湖北 武汉 电信
版主
★★★★★
积分 11,386
发帖 4,938
注册 2006-07-23 17:10
20年会员
UID 59080
状态 离线
第 3 楼
发表于 2007-03-24 12:19 · 中国 福建 三明 电信
新手上路
★
积分 18
发帖 7
注册 2006-12-20 00:26
19年会员
UID 73981
性别 男
状态 离线
我在把 echo off 加入每个批处理文件中的命令头(打个比方)
echo off 加入以下命令头
sfc /purgecache
sfc /purgecache
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\*.log
del /f /s /q %windir%\*.tmp
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
rd /s /q %temp% & md %temp%
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
让它变成:
echo off sfc /purgecache
echo off sfc /purgecache
............................................
第 4 楼
发表于 2007-03-24 12:23 · 中国 福建 三明 电信
新手上路
★
积分 18
发帖 7
注册 2006-12-20 00:26
19年会员
UID 73981
性别 男
状态 离线
或者在
regsvr32 actxprxy.dll
regsvr32 shdocvw.dll
regsvr32 oleaut32.dll
Regsvr32 URLMON.DLL
加入 /s 变成
regsvr32 /s actxprxy.dll
regsvr32 /s shdocvw.dll
regsvr32 /s oleaut32.dll
Regsvr32 /s URLMON.DLL
第 5 楼
发表于 2007-03-24 12:31 · 中国 湖北 武汉 电信
版主
★★★★★
积分 11,386
发帖 4,938
注册 2006-07-23 17:10
20年会员
UID 59080
状态 离线
回楼上的,你可以试着照这个例子去解决3楼的问题:
@echo off
del __new.bat 2>nul
for /f "tokens=1*" %%a in (test.txt) do (
echo %%a /s %%b>>__new.bat
)
start notepad __new.bat
第 6 楼
发表于 2007-03-24 12:43 · 中国 福建 三明 电信
新手上路
★
积分 18
发帖 7
注册 2006-12-20 00:26
19年会员
UID 73981
性别 男
状态 离线
论坛跳转: