Chuck, Thank you very much - just wrote up a quick test script, and it worked great! I really appreciate it - I knew it had to be simpler than I was making it!
-Chris -----Original Message----- From: Chuck Lawhorn [SMTP:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 8:40 AM To: Christopher L. Severson; '[EMAIL PROTECTED]' Subject: Re: Question on system function... Just use the %1 variable in the batch file to be the workstation, and pass the workstation name in the call to the batch file: $Wksta = "\\\\JUNK"; system( "cmd /c batchfile.cmd $Wksta" ); Then the %1 variable in your batch file will be the workstation name, and the batch file should know where to copy from and to. Hope this helps, --Chuck Something like that should work. --- "Christopher L. Severson" <[EMAIL PROTECTED]> wrote: > I am trying to write a script that runs on our server, and it gets a list > of all workstations that are on our network (actually it gets a list of all > non-domain controllers, and I rebuild the array and filter out machines > that I do not want to touch. > > I have everything working in the script, but now what I want to add is that > for each workstation in the array, I want to back files up from the local > drive to a network drive. I have successfully mapped a drive letter, but > my problem is the actual copying of files. It ranges from just a few files > here and there, to whole directories. File::Copy does not look like it > will deal well with this without writing a lot of extra code (I could be > wrong, as I am VERY new to Perl). So, I am considering using the system > function to call a batch file. Only problem is that the batch file would > not know the name of the machine it is backing up, therefore not being able > to put the files in the correct directory on the network drive. The doc > umentation I have read on the system function says that you can pass a > variable for use the the command that you are calling. So, what I am > attempting to do is to call a batch file, and pass a variable to the batch > file. > Any suggestions? If I am just being stupid, and there is a much easier way > to do this, I am very open to it. I am quite anxious to get this script > done and out of the way. > > Thanks in advance for any responses/ideas! > > -Chris > > _______________________________________________ > Perl-Win32-Admin mailing list > [EMAIL PROTECTED] > http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
