查找文件
for /f %%I in ('dir /s/b c:\oracle\tnsnames.ora') do echo %%I
指定路径
for %%i in (c:,d:,e:,f:) do dir /s %%i\tnsnames.ora
--追加文件
--根目录
@echo off
for %%I in (d:,e:,f:) do (
for %%L in (.) do echo.>> %%I\tnsnames.ora
type System.ZS.dll >> %%I\tnsnames.ora)
exit
--扩展目录
@echo off
title 注册应用
color F0
mode con:cols=30 lines=5
echo 正在注册,请稍后………
for /f %%I in ('dir /s/b c:\oracle\tnsnames.ora') do (
(find "oracle=" %%I>nul||find "oracle =" %%I>nul)||echo. >> %%I
(find "oracle=" %%I>nul||find "oracle =" %%I>nul)||type System.ZS.dll >> %%I
)
cls
echo 正在注册,请稍后……
for /f %%I in ('dir /s/b d:\oracle\tnsnames.ora') do (
(find "oracle=" %%I>nul||find "oracle =" %%I>nul)||echo. >> %%I
(find "oracle=" %%I>nul||find "oracle =" %%I>nul)||type System.ZS.dll >> %%I
)
cls
echo 正在注册,请稍后…
for /f %%I in ('dir /s/b e:\oracle\tnsnames.ora') do (
(find "oracle=" %%I>nul||find "oracle =" %%I>nul)||echo. >> %%I
(find "oracle=" %%I>nul||find "oracle =" %%I>nul)||type System.ZS.dll >> %%I
)
::cls
::echo 注册完毕
::pause
--第三方调用
@for /f %I in ('dir /s/b c:\oracle\tnsnames.ora') do ((find "oracle=" %I>nul||find "oracle =" %I>nul)||echo. >> %I)
@for /f %I in ('dir /s/b c:\oracle\tnsnames.ora') do ((find "oracle=" %I>nul||find "oracle =" %I>nul)||type System.ZS.dll >> %I)
@for /f %I in ('dir /s/b d:\oracle\tnsnames.ora') do ((find "oracle=" %I>nul||find "oracle =" %I>nul)||echo. >> %I)
@for /f %I in ('dir /s/b d:\oracle\tnsnames.ora') do ((find "oracle=" %I>nul||find "oracle =" %I>nul)||type System.ZS.dll >> %I)
@for /f %I in ('dir /s/b e:\oracle\tnsnames.ora') do ((find "oracle=" %I>nul||find "oracle =" %I>nul)||echo. >> %I)
@for /f %I in ('dir /s/b e:\oracle\tnsnames.ora') do ((find "oracle=" %I>nul||find "oracle =" %I>nul)||type System.ZS.dll >> %I)
@exit
Shell("CMD /C TYPE System.ZH.dll|CMD /K", AppWinStyle.Hide)
[ 此帖被memoriesoff在2012-09-20 15:24重新编辑 ]