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 12:39
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Copying files over the network View 1,924 Replies 2
Original Poster Posted 2010-09-25 15:16 ·  中国 北京 电信
新手上路
Credits 14
Posts 6
Joined 2010-09-19 21:36
15-year member
UID 174487
Gender Male
Status Offline
Server address: 10.50.20.19
Server name: archive
Directory name: cms

Question 1:

@echo off

echo Copy file
copy D:\sky\>*.txt \\archive\cms >>D:\sky.txt

%date%>>D:\sky.txt
%time%>>D:\sky.txt

Result:

Access denied.
2010-09-25 Saturday
13:34:39.69


Why can't it find the path here?

@echo off

echo Copy file

copy D:\*.txt \\10.50.20.19\cms >>D:\sky.txt

echo %date%>>D:\sky.txt
echo %time%>>D:\sky.txt

pause

This can be successful


Question 2:

1. Save this batch file as: b.bat and place it in D:\

2. Then use at 13:40 D:\b.bat

The result is: The task schedule can execute normally, but the file cannot be copied

D:\d.txt
0 file(s) copied.
2010-09-25 Saturday
13:40:00.13


What is the reason for this?
Floor 2 Posted 2011-01-13 15:49 ·  中国 上海 电信
中级用户
★★
Credits 240
Posts 115
Joined 2008-03-10 19:31
18-year member
UID 112561
Gender Male
Status Offline
I estimate you can't access it by the computer name. First, manually enter \\archive\cms in the cmd prompt and press Enter.
Floor 3 Posted 2011-01-14 16:27 ·  中国 北京 联通
新手上路
Credits 10
Posts 10
Joined 2010-11-18 20:41
15-year member
UID 177819
Gender Male
Status Offline
First, use net use to map the network drive, and then normal copy should be okay. The first success might be because the password has already been entered, so it can copy. The second time, it might be that the verification has timed out or some other reason, resulting in access denied.
Forum Jump: