Solved

How to copy files from server to server remotely?

Posted on 2008-10-24
8
916 Views
Last Modified: 2012-06-21
I have a 2 Windows 2003 servers, 1 dev, 1 stage.
Currently dev is mapped to stage with a simple folder share mapping.
Right now I log onto the dev server via RDP, and run an xcopy batch that copies from dev D:\www to the stage drive share Z:\www

I have to find a way to do this remotely without logging onto either server.
I tried psexec, but can't get it to work with mapped drives.
What other way can I copy these files, and I am open to an alternative other than mapped shares, I just need a solution where I don't have to logon to the server.

I thought about a manual scheduled task just running my batch, but I have no way to execute a scheduled task remotely either, but that would work also if there was a way. I need to execute this copy at will remotely, and I'm no developer. =/

Thank you.
0
Comment
Question by:jonburk
8 Comments
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 22799733
You can't do it with mapped drives because mapped drives don't exist within the context of psexec.  Just use the UNC.

So instead of Z:, if Z is mapped to \\server2\share then use that instead of z:
0
 
LVL 1

Expert Comment

by:moojee
ID: 22799802
Hi,

If you use a scheduled task you don't need to execute it remotely!
this is the work of a scheduled task.

You can't use it?
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22799853
in which case you still want to use the UNC, not a mapped drive letter.

0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

Author Comment

by:jonburk
ID: 22813084
I can't use just a schedulted task because they need to happen at will, not a set time interval. The scripts load development files to the test server, so the developer needs to be able to have the server load files at command so they can load, test, change the code, load, test, etc.

Is there a way I can make a manual scheduled task and let the developer start that task remotely whenever they want?
0
 
LVL 1

Expert Comment

by:moojee
ID: 22818145
tried to use the unc instead of a mapped drive in your xcopy script (run by psexec)?
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22818169
moojee: Yeah, I suggested that a couple of times.
0
 
LVL 1

Expert Comment

by:HudsonMarine
ID: 22898222
I am also trying to do something like this only i cant get psexec to work remotely with a mapped drive either and I am also trying to run a bat file remotely but it still says it cant find the destination

I changed my bat file from this:

copy s:\ProdDB\CONDB\CONDB\HMMSA.mdb %USERPROFILE%\myDocu~1\TECHDB\

to use the UNC like this:

copy \\HMMSNJ01\ProdDB\CONDB\CONDB\HMMSA.mdb %USERPROFILE%\myDocu~1\TECHDB\

but it still says the same thing:

The system cannot find the path specified.


am I writing the UNC correctly in my bat file?

is there a way to map the drive in the bat file so i can get the bat file to do its function which is copy a file from a server to the target PC?

I also listed my question here with no avail:

http://forum.sysinternals.com/forum_posts.asp?TID=16742

Thanks for anyone who can help.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

840 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