Solved

How to copy files from server to server remotely?

Posted on 2008-10-24
8
911 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now