Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - copy folder to a network share???

Reply
 
Old 10-12-2009   #1 (permalink)
sideshow


 
 

copy folder to a network share???

Hopefully someone can help me see what is going on with a little .cmd file
that I wanted to copy data from WindowsXP PCs to a network share. First, the
command :

\\dc1\readme\robocopy.exe "%USERPROFILE%\My Documents" "%HOMESHARE%\My
Documents" /COPYALL /v /NP /R:2 /w:3

And the SET info from one of the PCs:
HOMEDRIVE=Z:
HOMEPATH=\
HOMESHARE=\\Dc1\Users\jwayne
LOGONSERVER=\\DC1
USERNAME=jwayne
USERPROFILE=C:\Documents and Settings\jwayne

If this command is run from any of the PCs for the first time it will create
a folder in the %HOMESHARE% folder on the network, but instead of calling it
"My Documents" as the command says, it calls it "teacher's Documents". I
have no idea why. And it copies no data into the folder on the network, but
I am unsure whether that is correct or not, because I do not know where this
"teacher's documents" folder is. Any idea where I went wrong? thanks


My System SpecsSystem Spec
Old 10-12-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: copy folder to a network share???


"sideshow" <sideshow@newsgroup> wrote in message
news:45D15D35-51C2-4704-9E2B-2EC30133F84F@newsgroup
Quote:

> Hopefully someone can help me see what is going on with a little .cmd file
> that I wanted to copy data from WindowsXP PCs to a network share. First,
> the
> command :
>
> \\dc1\readme\robocopy.exe "%USERPROFILE%\My Documents" "%HOMESHARE%\My
> Documents" /COPYALL /v /NP /R:2 /w:3
>
> And the SET info from one of the PCs:
> HOMEDRIVE=Z:
> HOMEPATH=\
> HOMESHARE=\\Dc1\Users\jwayne
> LOGONSERVER=\\DC1
> USERNAME=jwayne
> USERPROFILE=C:\Documents and Settings\jwayne
>
> If this command is run from any of the PCs for the first time it will
> create
> a folder in the %HOMESHARE% folder on the network, but instead of calling
> it
> "My Documents" as the command says, it calls it "teacher's Documents". I
> have no idea why. And it copies no data into the folder on the network,
> but
> I am unsure whether that is correct or not, because I do not know where
> this
> "teacher's documents" folder is. Any idea where I went wrong? thanks
>
I suspect that you obtained the above environmental variables from an
instance of the Command Processor other than the one you used for the
robocopy command. To be sure that you're looking at the right thing, you
should use a batch file similar to this one:
@echo off
set > c:\set.txt
\\dc1\readme\robocopy.exe "%USERPROFILE%\My Documents" "%HOMESHARE%\My
Documents" /COPYALL /v /NP /R:2 /w:3

Now have a look at c:\set.txt and see if the apparent contradiction still
exists.


My System SpecsSystem Spec
Old 10-14-2009   #3 (permalink)
sideshowblah


 
 

Re: copy folder to a network share???

Thanks. Even from the code you sent the SET parameters are still the same as I pasted before and this mysterious "teacher" does not show up in there anywhere. Any other ideas of what I might have done wrong?



Pegasus [MVP] wrote:
Quote:

> "sideshow" <sideshow@newsgroup> wrote in message
> news:45D15D35-51C2-4704-9E2B-2EC30133F84F@newsgroup
Quote:

>> Hopefully someone can help me see what is going on with a little .cmd file
>> that I wanted to copy data from WindowsXP PCs to a network share. First,
>> the
>> command :
>>
>> \\dc1\readme\robocopy.exe "%USERPROFILE%\My Documents" "%HOMESHARE%\My
>> Documents" /COPYALL /v /NP /R:2 /w:3
>>
>> And the SET info from one of the PCs:
>> HOMEDRIVE=Z:
>> HOMEPATH=\
>> HOMESHARE=\\Dc1\Users\jwayne
>> LOGONSERVER=\\DC1
>> USERNAME=jwayne
>> USERPROFILE=C:\Documents and Settings\jwayne
>>
>> If this command is run from any of the PCs for the first time it will
>> create
>> a folder in the %HOMESHARE% folder on the network, but instead of calling
>> it
>> "My Documents" as the command says, it calls it "teacher's Documents". I
>> have no idea why. And it copies no data into the folder on the network,
>> but
>> I am unsure whether that is correct or not, because I do not know where
>> this
>> "teacher's documents" folder is. Any idea where I went wrong? thanks
>>
>
> I suspect that you obtained the above environmental variables from an
> instance of the Command Processor other than the one you used for the
> robocopy command. To be sure that you're looking at the right thing, you
> should use a batch file similar to this one:
> @echo off
> set > c:\set.txt
> \\dc1\readme\robocopy.exe "%USERPROFILE%\My Documents" "%HOMESHARE%\My
> Documents" /COPYALL /v /NP /R:2 /w:3
>
> Now have a look at c:\set.txt and see if the apparent contradiction still
> exists.
>
>
My System SpecsSystem Spec
Old 10-14-2009   #4 (permalink)
Pegasus [MVP]


 
 

Re: copy folder to a network share???


"sideshowblah" <sideshowblah@newsgroup> wrote in message
news:uW6g0MPTKHA.1280@newsgroup
Quote:

> Thanks. Even from the code you sent the SET parameters are still the same
> as I pasted before and this mysterious "teacher" does not show up in there
> anywhere. Any other ideas of what I might have done wrong?
>
What you report goes against everything known about accessing file shares
and environmental variables. To really nail down what you claim, run the
self-documenting batch file below, then post the contents of c:\test.txt.

@echo off
if exist "%HOMESHARE%\My Documents" (
echo Sorry, the folder "%HOMESHARE%\My Documents" already exists.
echo Please save its files elsewhere, then delete the folder."
echo.
pause
goto :eof
)

if exist "%HOMESHARE%\Teacher's Documents" (
echo Sorry, the folder "%HOMESHARE%\Teacher's Documents" already exists.
echo Please save its files elsewhere, then delete the folder."
echo.
pause
goto :eof
)

echo %date% %time% > c:\test.txt
set >> c:\test.txt
echo. >> c:\test.txt
echo Source folder=%USERPROFILE%\My Documents >> c:\test.txt
echo Target folder=%HOMESHARE%\My Documents >> c:\test.txt
\\dc1\readme\robocopy.exe "%USERPROFILE%\My Documents" "%HOMESHARE%\My
Documents" /COPYALL /v /NP /R:2 /w:3 1>>c:\test.txt 2>>&1
echo. >> c:\test.txt
echo Contents of %HOMESHARE%\My Documents: >>c:\test.txt
dir "%HOMESHARE%\My Documents" 1>>c:\test.txt 2>>&1
echo. >> c:\test.txt
echo Contents of %HOMESHARE%\Teacher's Documents: >>c:\test.txt
dir "%HOMESHARE%\Teacher's Documents" 1>>c:\test.txt 2>>&1
echo. >> c:\test.txt
set >> c:\test.txt
echo %date% %time% >> c:\test.txt


My System SpecsSystem Spec
Old 10-26-2009   #5 (permalink)
sideshowblah


 
 

Re: copy folder to a network share???

thanks for your help. The script helped me see more clearly what I was looking at. The problem is with Windows Explorer showing the folder name that is created by the script as "teacher's documents" and the actual name is "My Documents" as shown with a "dir \\DC1\jwayne\"

Still not sure why Explorer shows this different name, but I guess I get to that later. thanks for your help with the script.

Pegasus [MVP] wrote:
Quote:

> "sideshowblah" <sideshowblah@newsgroup> wrote in message
> news:uW6g0MPTKHA.1280@newsgroup
Quote:

>> Thanks. Even from the code you sent the SET parameters are still the same
>> as I pasted before and this mysterious "teacher" does not show up in there
>> anywhere. Any other ideas of what I might have done wrong?
>>
>
> What you report goes against everything known about accessing file shares
> and environmental variables. To really nail down what you claim, run the
> self-documenting batch file below, then post the contents of c:\test.txt.
>
> @echo off
> if exist "%HOMESHARE%\My Documents" (
> echo Sorry, the folder "%HOMESHARE%\My Documents" already exists.
> echo Please save its files elsewhere, then delete the folder."
> echo.
> pause
> goto :eof
> )
>
> if exist "%HOMESHARE%\Teacher's Documents" (
> echo Sorry, the folder "%HOMESHARE%\Teacher's Documents" already exists.
> echo Please save its files elsewhere, then delete the folder."
> echo.
> pause
> goto :eof
> )
>
> echo %date% %time% > c:\test.txt
> set >> c:\test.txt
> echo. >> c:\test.txt
> echo Source folder=%USERPROFILE%\My Documents >> c:\test.txt
> echo Target folder=%HOMESHARE%\My Documents >> c:\test.txt
> \\dc1\readme\robocopy.exe "%USERPROFILE%\My Documents" "%HOMESHARE%\My
> Documents" /COPYALL /v /NP /R:2 /w:3 1>>c:\test.txt 2>>&1
> echo. >> c:\test.txt
> echo Contents of %HOMESHARE%\My Documents: >>c:\test.txt
> dir "%HOMESHARE%\My Documents" 1>>c:\test.txt 2>>&1
> echo. >> c:\test.txt
> echo Contents of %HOMESHARE%\Teacher's Documents: >>c:\test.txt
> dir "%HOMESHARE%\Teacher's Documents" 1>>c:\test.txt 2>>&1
> echo. >> c:\test.txt
> set >> c:\test.txt
> echo %date% %time% >> c:\test.txt
>
>
My System SpecsSystem Spec
Old 10-26-2009   #6 (permalink)
Pegasus [MVP]


 
 

Re: copy folder to a network share???

Thanks for the feedback.

"sideshowblah" <sideshowblah@newsgroup> wrote in message
news:%23jF8nKkVKHA.4780@newsgroup
Quote:

> thanks for your help. The script helped me see more clearly what I was
> looking at. The problem is with Windows Explorer showing the folder name
> that is created by the script as "teacher's documents" and the actual name
> is "My Documents" as shown with a "dir \\DC1\jwayne\"
> Still not sure why Explorer shows this different name, but I guess I get
> to that later. thanks for your help with the script.
>
> Pegasus [MVP] wrote:
Quote:

>> "sideshowblah" <sideshowblah@newsgroup> wrote in message
>> news:uW6g0MPTKHA.1280@newsgroup
Quote:

>>> Thanks. Even from the code you sent the SET parameters are still the
>>> same as I pasted before and this mysterious "teacher" does not show up
>>> in there anywhere. Any other ideas of what I might have done wrong?
>>>
>>
>> What you report goes against everything known about accessing file shares
>> and environmental variables. To really nail down what you claim, run the
>> self-documenting batch file below, then post the contents of c:\test.txt.
>>
>> @echo off
>> if exist "%HOMESHARE%\My Documents" (
>> echo Sorry, the folder "%HOMESHARE%\My Documents" already exists.
>> echo Please save its files elsewhere, then delete the folder."
>> echo.
>> pause
>> goto :eof
>> )
>>
>> if exist "%HOMESHARE%\Teacher's Documents" (
>> echo Sorry, the folder "%HOMESHARE%\Teacher's Documents" already
>> exists.
>> echo Please save its files elsewhere, then delete the folder."
>> echo.
>> pause
>> goto :eof
>> )
>>
>> echo %date% %time% > c:\test.txt
>> set >> c:\test.txt
>> echo. >> c:\test.txt
>> echo Source folder=%USERPROFILE%\My Documents >> c:\test.txt
>> echo Target folder=%HOMESHARE%\My Documents >> c:\test.txt
>> \\dc1\readme\robocopy.exe "%USERPROFILE%\My Documents" "%HOMESHARE%\My
>> Documents" /COPYALL /v /NP /R:2 /w:3 1>>c:\test.txt 2>>&1
>> echo. >> c:\test.txt
>> echo Contents of %HOMESHARE%\My Documents: >>c:\test.txt
>> dir "%HOMESHARE%\My Documents" 1>>c:\test.txt 2>>&1
>> echo. >> c:\test.txt
>> echo Contents of %HOMESHARE%\Teacher's Documents: >>c:\test.txt
>> dir "%HOMESHARE%\Teacher's Documents" 1>>c:\test.txt 2>>&1
>> echo. >> c:\test.txt
>> set >> c:\test.txt
>> echo %date% %time% >> c:\test.txt
>>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Vista can't copy files from network share on XPPro Vista networking & sharing
copy folder with hidden share VB Script
Vista requires admin rights to copy file to network share Vista networking & sharing
Copy from network share hangs, can't cancel, can't shutdown....... Vista General
Copy to network share on Vista machine causes error Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46