China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 11:23
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Regarding copying and registering DLL files, thank you in advance to the experts! View 2,213 Replies 4
Original Poster Posted 2010-11-29 21:04 ·  中国 广东 珠海 联通
新手上路
Credits 12
Posts 12
Joined 2010-11-28 22:26
15-year member
UID 178455
Gender Male
Status Offline
I'm tinkering with a batch program and I'm stuck. I'd like some expert advice:

@echo off
Title=Welcome to Use the Client Foolish Update Program`-`

if exist C:\Xcopyfile.txt del C:\Xcopyfile.txt /q /f

xcopy \\192.168.1.101\客户端\fmis3.0_release :\ygfmis\bin /d /i /s /c /e /h /y > C:\Xcopyfile.txt

for /f "delims=" %%i in (c:\Xcopyfile.txt) do (findstr "*.dll" "%%i" >c:\Regonlyfile.txt)

for /f "tokens=*" %%m in (c:\Regonlyfile.txt) do (
echo. & echo Registering this file: %%m
tregsvr %%m)
endlocal
:end
echo.
echo Registration completed successfully!

Description: The function to be implemented is very simple. It's to copy the client files from the server path to this computer, and only register the dll files, that is, open them with C:\WINDOWS\system32\regsvr32. I'm still in the learning stage, and I don't understand many things. Please help me modify it. I know there's a problem starting from the for loop...
Floor 2 Posted 2010-11-30 00:01 ·  中国 吉林 延边朝鲜族自治州 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
```
@echo off&Title=Welcome to use the client fool-style update program
xcopy \\192.168.1.101\Client\fmis3.0_release C:\ygfmis\bin /discehy>C:\Xcopyfile.txt
for /f "delims=" %%a in ('findstr /i \.dll C:\Xcopyfile.txt') do (
echo/&echo Registering this file: %%a
Regsvr32 /s "%%a"
)
echo/&echo Registration completed successfully!&pause
```
Recent Ratings for This Post ( 3 in total) Click for details
RaterScoreTime
sybwyn +1 2010-11-30 20:16
zaixinxiangnian +2 2010-12-02 00:39
cyn01livecn +1 2011-01-18 14:53
Floor 3 Posted 2010-11-30 20:17 ·  中国 广东 珠海 联通
新手上路
Credits 12
Posts 12
Joined 2010-11-28 22:26
15-year member
UID 178455
Gender Male
Status Offline
Thanks to the expert! I've given you points!
Floor 4 Posted 2010-12-02 00:40 ·  中国 广东 佛山 顺德区 电信
初级用户
★★
Credits 151
Posts 106
Joined 2009-10-09 21:24
16-year member
UID 152856
Gender Male
From 河南省
Status Offline
I also give you extra points,,,,, I think Hanyeguxing is very proficient in using FOR
Floor 5 Posted 2011-01-18 14:52 ·  中国 上海 东方有线
初级用户
Credits 28
Posts 23
Joined 2010-11-26 11:37
15-year member
UID 178303
Gender Male
Status Offline
Forum Jump: