Page 1 of 1 1
Topic Options
#74827 - 2003-05-06 02:18 AM How to silence file copy on Windows 9x
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Currently using v4.12

The following code works as expected on NT/2000/XP

code:
$FileSource="\\SERVER\SHARE\"
SHELL '%comspec% /c copy $FileSource\*.* %temp% >nul 2>nul'

Can not seem to make the correct usage of quotes to get Windows 95 to operate the same. I can get the files to copy, but not silently.

Have reviewed FAQ already.

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=10;t=000069

and here

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=14;t=000315

Does anyone know the correct code to make this work on Windows 9x?

Top
#74828 - 2003-05-06 03:15 AM Re: How to silence file copy on Windows 9x
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Well, seems Howard was correct. Windows 9x COMMAND.COM can't redirect stderr

Windows NT can though.

Here are a couple of links about it as well.

http://www.teaser.fr/~amajorel/stderr/

Using command redirection operators
http://www.microsoft.com/technet/treeview/d efault.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/entserver/redirection.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en- us/vclib/html/_crt_stdin.2c_.stdout.2c_.stderr.asp

http://www.winscriptingsolutions.com/Articles/Index.cfm?ArticleID=7462

[ 06. May 2003, 05:07: Message edited by: NTDOC ]

Top
#74829 - 2003-05-06 01:54 PM Re: How to silence file copy on Windows 9x
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Doc,

From the 4.12 docs (You tried this already?)

Why not use KiXtart copy command (native)?

quote:

COPY "source" "destination" [/h]

Remarks
Wildcards are supported.
If a file already exists at the destination, it is overwritten without warning.
The /h option can be used to include files with the hidden or system attribute set in the copy.

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#74830 - 2003-05-07 02:53 AM Re: How to silence file copy on Windows 9x
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Thanks Kent, but the reason for not using the Native COPY is that it will not wait for the files to be copied before it moves on to the next lines of the script, which try to call those files it just copied. Over some LAN/WAN connections these files are not copied fast enough before they are called.

Then the script does not work correctly. The code works fine for NT, I used the Native COPY and added a 5 sec sleep to the Windows 9x section.

Top
#74831 - 2003-05-07 03:42 AM Re: How to silence file copy on Windows 9x
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Doc, you sure? You can check the result of a copy with @error. How would that be possible if COPY did not complete before executing the next line?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#74832 - 2003-05-07 04:58 AM Re: How to silence file copy on Windows 9x
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Winteendos have a problem with the disk cache. If you read in a directory before the copy, and then read it again after, it will serve up the cached copy from the first.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#74833 - 2003-05-07 06:01 AM Re: How to silence file copy on Windows 9x
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Because I'm doing a wildcard copy.

I have tested it without an @error and the script DOES move on before the copy. I'm using 4.12 in production which I don't even remember if the @error was broken in that version or not.

However, I'm guessing that once the first file is copied it will give @error the 0 succesful entry.

I could test this further, but I've already put the script into production using the SLEEP 5 for Windows 9x

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.148 seconds in which 0.053 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org