473,748 Members | 6,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to copy files from mapped drive to server via my machine?

2 New Member
Hi I am trying to copy files from mapped drive (J:\) to a different machine.
The perl script is going to run on my machine to copy files from one place to another.

File transfer works when i copy files from mapped drive to my machine but when I tried to copy over to different machine throws me an error:

Please help me recrify

Here is my perl script as follows:

Expand|Select|Wrap|Line Numbers
  1. use File::Copy; 
  2.  
  3. $dir="\\\\SOURCE\\PROD_LOGFILES\\LogFiles\\"; 
  4.  
  5. opendir(DIR, $dir) or die "can not open directory $dir: $! \n"; 
  6.  
  7. @files=readdir(DIR); 
  8. closedir DIR; 
  9.  
  10. foreach $file (@files) { 
  11.   if (-f "$dir$file") {   
  12.  
  13. $moveloc="\\\\TARGET\\D\$\\FMP Project\\Production Log Files\\";  
  14.  
  15. $old = "$dir$file"; 
  16. $new = "$moveloc"; 
  17. #copy($old, $new) or die "Copy Failed: $!"; #this line is working for my machine
  18. move($old, $new) or die "Copy Failed: $!"; 
  19. }
  20. }
  21.  
Oct 26 '10 #1
2 3222
chorny
80 Recognized Expert New Member
What error message do you receive?
Oct 28 '10 #2
parmarjm
2 New Member
Chorny
I tried running the script got below error:

C:\PERL\BIN>per l try_perl.pl
Copy Failed: No such file or directory at try_perl.pl line 18.

It seems didn't find the appropriate target directory to land files.

can you please guide.
Jay
Nov 1 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
530
by: durumdara | last post by:
Hi ! I have some backup files on a server farm. I want to store these local backup files on a backup file server for "safety's snake". These files are compressed zip files with 12 character length password. But my system admin asked me, how can I improve the safety of the copy operation, and the storing (now I use Samba share to store these files. I map the SMB share on the client, copy these files, and unmap SMB).
1
2751
by: Green | last post by:
Hi, I had a question about how to copy files from server to server on the same LAN. Basically, i need to copy files from "develope server" to the "test server", then eventually to the "production server". But i don't know how to deal with this. Do you have any example code or hint? I appreciate in advance!
0
1494
by: ade tether via .NET 247 | last post by:
trying to find away in c# and wmi to login to a remote machine and copy the files to my local machine i have done parts in stages but there dosnt appear to be a step by step howto anywhere that i have googled any help would be great thanks -------------------------------- From: ade tether ----------------------- Posted by a user from .NET 247 (http://www.dotnet247.com/)
5
4476
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a seperate files server. we have mapped the fodler to a different folder and need to allow the EXE to process on the mapped drive. When I trigger the EXE via web service the EXE get the permission of the launching user (mean ASP.NET user) resulting a...
8
6212
by: Chris Strobel | last post by:
I have 2 web servers where I need to write a PDF file and need to keep them in sync. In others words, If the Server1 is getting called to create the PDF, then it needs to copy the PDF to the other Server2 and visa-versa. The 2 server are running 2003. It's a form-based authentication (.NET 1.1) site and I'm using IIS 6 native mode. Both boxes are set to the same workgroup. Since everything is so locked down now, I'm not sure what's the...
6
14566
by: zerbie45 | last post by:
Hi all, I need to know if, and how, it is possible to use ASP to download a file automatically from the web server to the client in a given path. Is that possible ? Ideally I want a page with a link that when pressed it will copy a certain file that exists on the web server down to the client. Any help is appreciated!
1
2516
by: maz01 | last post by:
Hello All, I am developing an application in visual basic 2005 that will run continuously in the background on a users workstation. This application will automatically transfer files from the local machine to a remote server and vise versa. It checks for the files on a timed interval. I have two problems with this application that I am having trouble figuring out: The first problem is that the cmd.exe shell pops up on the screen every...
4
11738
by: sajid_yusuf | last post by:
Hi I am trying to develop a Windows service in VB.NET which has timer enabled and keeps checking a folder (or group of folders) for any new file or changed files. As soon as it detects any new file or changes (to files or folders) then it copies the files (and any new folders) to a folder in the mapped network drive. So far I have been successful in developing and deploying the service which works on my local machine with two drives...
1
2907
fnwtech
by: fnwtech | last post by:
Here is my newest dilemma :) I need a login script which will copy files from the server to clients at login. This is what I have: md c:\lad @echo off xcopy lab1\\c:\lad c:\lad /m /e /y cd\ cd lad regsvr32.exe mousewheel.dll
1
1127
by: nussu | last post by:
Hi, I am writing a console application in .net to move or copy files from one server to another server . I am not getting any idea right now..Could u plz provide me links or logic. Thanks a lot if u help me. Regards, Nussu
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.