#193505 - 2009-04-18 02:23 AM
Move Command
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
This is kind of a dumb one but for some reason I can't get this move command to work. Is there something wrong with this syntax?
MOVE "\\SF1-FILE-1\USERS\@USERID\My Music\" "%SystemDrive%\My Music\" /c/h/r/s
|
Top
|
|
|
|
#193528 - 2009-04-21 08:33 PM
Re: Move Command
[Re: Glenn Barnas]
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
NoMacrosInStrings is set to OFF as the default setting
-The COPY command will work and will copy the "My Music" directory -Either of the MOVE commands above will not move the "My Music" directory. -I can rename or delete the "My Music" director so I don't think it's a rights issue. -Could there be something else with the syntax??
Thanks, Jeff
|
Top
|
|
|
|
#193529 - 2009-04-21 08:37 PM
Re: Move Command
[Re: Glenn Barnas]
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
Also, the debug seems to show the correct syntax:
Moving \\SF1-FILE-1\USERS\username\My Music\ to C:\My Music\
Jeff
|
Top
|
|
|
|
#193531 - 2009-04-21 09:36 PM
Re: Move Command
[Re: Gargoyle]
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
Thanks:
Moving \\SF1-FILE-1\USERS\username\My Music\ to "C:\My Music\ Return code was 87 this means The parameter is incorrect
Could it have something to do with the placement of quotes?
|
Top
|
|
|
|
#193539 - 2009-04-22 05:13 AM
Re: Move Command
[Re: Glenn Barnas]
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
Actually, I had corrected that and got a different error:
My corrected syntax now is:$Src = '"\\JA-FILE1\USERS\' + @USERID + '\My Music\"'
$Dst = '"%SystemDrive%\My Music\"'
Move $Src $Dst /c /h /r /s
And the error is get now is... and this is verbatum: "Return code was 123 means tax is incorrect.ectory name, or volume label syn"
what does this mean, and could you tell me where I reference the codes?
Thanks again for your help.
Jeff
Edited by Glenn Barnas (2009-04-22 05:39 AM) Edit Reason: add code tags
|
Top
|
|
|
|
#193571 - 2009-04-23 07:17 PM
Re: Move Command
[Re: Glenn Barnas]
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
OK...
The MOVE command works fine if it uses drive letters. But once I change it to UNC it fails. I think the problem centers around UNC.
I think this syntax is fine. Printing the vars looks correct with quotes. $Src = '"\\JA-FILE1\USERS\' + @USERID + '\My Music\"'
But if I copy it directly to kix, I get an error. Even if I put a very simple path like "\\Server\share\folder\", I get the same error:
"Return code was 123 this means The filename, directory name, or volume label syntax is incorrect"
Is there some special syntax for UNC? I've never had an issue with UNC vs drive letter specifications.
Thanks, JEff
|
Top
|
|
|
|
#193575 - 2009-04-24 12:43 AM
Re: Move Command
[Re: NTDOC]
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
But wouldn't this be a "short" filename:
"\\Server\share\folder\"
The exact path was: "\\JA-FILE1\External\Test"
And I still got the error. Do you mean spaces by long?
Jeff.
|
Top
|
|
|
|
#193591 - 2009-04-24 07:31 PM
Re: Move Command
[Re: Glenn Barnas]
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
Thanks. That works on my end as well. But when I try to move the entire folder "My Music" located on a UNC to the local drive, it does not work.
I'm trying to move \\Server\Share\My Test to C:\My Test
It seems that moving a file works but not an entire folder even with the switch /s even if I create the folder in the destination (MD) wehn it does not exist.
However, "COPY" does work. So I tried to run the COPY command followed up with an "RD /s" which did not work. Perhaps the problem with the MOVE command has to do with removing the directory when it's finished?
Jeff.
|
Top
|
|
|
|
#193595 - 2009-04-24 11:42 PM
Re: Move Command
[Re: jeff_eisenberg]
|
jeff_eisenberg
Fresh Scripter
Registered: 2009-02-26
Posts: 45
Loc: CA
|
I think I can do the following. Could you just help me with proper quotage around the var in the second line. How would you break out of the shell command to specify the $Src var?
COPY $Src $Dst /s Shell "%ComSpec% /c RD $Src /S /Q"
Jeff.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 515 anonymous users online.
|
|
|