#145296 - 2005-08-11 02:09 AM
Move not overwriting when using UNC Path as destination
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Using KiXtart 2010 4.50 Code:
Break On Move "D:\MyFolder\MyFile1.txt" "\\MyComputer\MyShare" ? @ERROR ": " @SERROR Copy "D:\MyFolder\MyFile2.txt" "\\MyComputer\MyShare" ? @ERROR ": " @SERROR Move "D:\MyFolder\MyFile2.txt" "\\MyComputer\MyShare" ? @ERROR ": " @SERROR
The kix2010 manual tells for the "Move" command that:
Quote:
MOVE overwrites existing files without warning.
But when moving to an UNC style path and when the destination file exists, the file is not overwritten. The Error Code is 80, telling it exists.
|
Top
|
|
|
|
#145298 - 2005-08-11 07:57 AM
Re: Move not overwriting when using UNC Path as destination
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Code:
Break On Move "D:\MyFolder\MyFile1.txt" "\\MyComputer\MyShare\" ? @ERROR ": " @SERROR Copy "D:\MyFolder\MyFile2.txt" "\\MyComputer\MyShare\" ? @ERROR ": " @SERROR Move "D:\MyFolder\MyFile2.txt" "\\MyComputer\MyShare\" ? @ERROR ": " @SERROR
You are right, but I see no difference. In my example, the destination path exists.
Edited by Witto (2005-08-11 07:59 AM)
|
Top
|
|
|
|
#145302 - 2005-09-29 09:39 PM
Re: Move not overwriting when using UNC Path as destination
|
iffy
Starting to like KiXtart
Registered: 2005-05-29
Posts: 149
Loc: The Netherlands
|
Sealeopard, what version where you using when testing this? Or did you simply quote from the manual? I've also done some quick testing with 4.50 and come to the same conclusion as the topic starter. So it appears not to be a RTFM issue afterall...
The line in the documentation about the trailing backslash is obviously meant when moving directories and not for files.
The overwriting comment is for doing something like this: Code:
Move "D:\MyFolder\MyFile2.txt" "D:\MyFolder\MyFile3.txt"
The above does overwrite without warning.
So we have: a) a bug b) a minor documentation error
"If the source or target specifies a directory, please make sure to add a trailing backslash."
Should be something like:
"When moving directories, please make sure to add a trailing backslash."
Nice double catch Witto.
Edited by iffy (2005-09-29 09:40 PM)
|
Top
|
|
|
|
#145304 - 2005-11-29 03:25 PM
Re: Move not overwriting when using UNC Path as destination
|
Karl Napp
Fresh Scripter
Registered: 2003-04-10
Posts: 5
|
Cannot move folders over Shares
Hello!
I run into some difficulties when I try to move folders:
This code works: Code:
$src="c:\tmp\sourcefolder\" $dest="c:\tmp\Destination\" Move $src $dest
This one doesn't: Code:
$src="\\server\share1\sourcefolder\" $dest="\\server\share2\" Move $src $dest
Error number and message are:
Quote:
ERROR 123: The filename, directory name, or volume label syntax is incorrect.
I tried it with COM: Code:
$fso = CreateObject("Scripting.FileSystemObject") $err=$fso.MoveFolder($src, $dest) $fso=0
and get no error in both cases (local and remote move) - but nothing happens...
Can somebody please push me in the right direction? I prefer working with Shares.
Thank you very much in advance.
|
Top
|
|
|
|
#145306 - 2005-12-31 02:08 AM
Re: Move not overwriting when using UNC Path as destination
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Also 4.52 Beta1 not overwriting the target if
- the target exists
- the target is to be found via an UNC path
Code:
Break On $ = Open(1, "C:\Test1.txt", 1) $ = Close(1) $ = Open(1, "C:\Test2.txt", 1) $ = Close(1) Move "C:\Test1.txt" "\\"+@WKSTA+"\C$\Test2.txt" ? @ERROR ": " @SERROR ? @KIX
|
Top
|
|
|
|
Moderator: ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 507 anonymous users online.
|
|
|