?
Solved

xcopy to mapped drive windows 8

Posted on 2013-01-10
8
Medium Priority
?
1,938 Views
Last Modified: 2013-01-16
The below command works for me in windows xp and windows 7, however I have a new build in windows 8 and it no longer works.  It says "Invalid Drive Specification"

The p: drive is a mapped network drive.  I think it has something to do with that because if I simply change the p: to e: (local drive) the xcopy command works.  

I can change directory to the P:\ path from command-line, shrug...

xcopy %USERPROFILE%\Favorites\*.* p:\backups\%username%\Favorites\ /s /y

Open in new window

0
Comment
Question by:icecom4
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:zackmccracken
ID: 38764468
could you try using quotes around the destination location "p:\backups\%username%\Favorites\"  ?
0
 
LVL 2

Expert Comment

by:bcruse32347
ID: 38764481
According to documentation this command should work. Have you checked the command prompt to see if you can see files and folders in p: drive and navigate the folders?
0
 

Author Comment

by:icecom4
ID: 38764735
@ Zack
yes, I tryed quotes on the destination, I also tried quotes on source, separately and both.  

@ Bcr
it creates the folders, then stops

but, this gets stranger.  I just ran it not using "run as administrator" and it works.  I am not clapping for joy, because I do not understand why this is happening.  Most of my batches require to be ran as administrator on Win7/8, this is the first time I have seen something not work as admin.  

It means I cannot include this script in some of the other batches which require run as admin, kind of annoying.  

Any thoughts on why this is happening?  Is it perhaps that run as admin causes it to drop authentication for the mapped drive?  I don't know why that would be, I shared it to everyone group.
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 3

Expert Comment

by:zackmccracken
ID: 38764792
run as admin is a different user and does not have the mapping you have created with your own user
0
 

Author Comment

by:icecom4
ID: 38764827
A)  Is there a way to map the same mapped drive to administrator then?  

or

B) how can I run the command as the existing user from another batch file?  
runas won't work because it haults for a password, stopping the whole script.
0
 

Accepted Solution

by:
icecom4 earned 0 total points
ID: 38764851
I think I found the solution to the A problem here...
http://www.winhelponline.com/blog/mapped-drives-are-not-seen-from-elevated-command-prompt-in-vista/

Any advise on B though?
0
 
LVL 3

Assisted Solution

by:zackmccracken
zackmccracken earned 2000 total points
ID: 38764871
make sure you run the script with the same user as mapping the drive with

or schedule to run the batch file from a scheduled task with a specific user
you can run a batch from within a batch with the call command.
0
 

Author Closing Comment

by:icecom4
ID: 38782027
This link has the exact solution to the problem.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
Detailed instructions on how to install an Access add-in in recent versions of Office and Windows (with screen shots)
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question