how to do operation on a mapped drive

how to do operation on a mapped drive

am 08.10.2007 13:20:15 von Andy

I have a remote server and I have mapped one drive from that remote
server into my local machine to access a perticular directory in that.

But I have to restart my local machine again and again. So again i
have to reconnect to the mapped drive by giving the userid and
password.

As I have to copy a file from that mapped drive and run that file on
the local machine after restarting the local machine.

The above process i have to do for each new file added into that
mapped drive.
So the steps are:
1: detect the file added to the mapped drive.
2: copy to the local machine.
3: restart the local machine.
4: Run that copied file.
5: do the same process continuously so that each time a new file is
added to the mapped drive it will detect, copy the same file and
restart the machine.

How can this be done using perl.

Re: how to do operation on a mapped drive

am 08.10.2007 17:48:54 von Ron Bergin

On Oct 8, 4:20 am, andy wrote:
> I have a remote server and I have mapped one drive from that remote
> server into my local machine to access a perticular directory in that.
>
> But I have to restart my local machine again and again. So again i
> have to reconnect to the mapped drive by giving the userid and
> password.
>
> As I have to copy a file from that mapped drive and run that file on
> the local machine after restarting the local machine.
>
> The above process i have to do for each new file added into that
> mapped drive.
> So the steps are:
> 1: detect the file added to the mapped drive.
> 2: copy to the local machine.
> 3: restart the local machine.
> 4: Run that copied file.
> 5: do the same process continuously so that each time a new file is
> added to the mapped drive it will detect, copy the same file and
> restart the machine.
>
> How can this be done using perl.

Why do you need to reboot your computer each time you copy a file?

Please make an attempt at writing the script then post it and specific
questions when you have a problem and we'll be happy to help.

If you need/want someone to write it for you, then you may want to
check out:
http://www.rentacoder.com/RentACoder/default.asp

Re: how to do operation on a mapped drive

am 09.10.2007 04:10:42 von Andy

On Oct 8, 8:48 pm, Ron Bergin wrote:
> On Oct 8, 4:20 am, andy wrote:
>
>
>
> > I have a remote server and I have mapped one drive from that remote
> > server into my local machine to access a perticular directory in that.
>
> > But I have to restart my local machine again and again. So again i
> > have to reconnect to the mapped drive by giving the userid and
> > password.
>
> > As I have to copy a file from that mapped drive and run that file on
> > the local machine after restarting the local machine.
>
> > The above process i have to do for each new file added into that
> > mapped drive.
> > So the steps are:
> > 1: detect the file added to the mapped drive.
> > 2: copy to the local machine.
> > 3: restart the local machine.
> > 4: Run that copied file.
> > 5: do the same process continuously so that each time a new file is
> > added to the mapped drive it will detect, copy the same file and
> > restart the machine.
>
> > How can this be done using perl.
>
> Why do you need to reboot your computer each time you copy a file?
>
> Please make an attempt at writing the script then post it and specific
> questions when you have a problem and we'll be happy to help.
>
> If you need/want someone to write it for you, then you may want to
> check out:http://www.rentacoder.com/RentACoder/default.asp

No its not like that. I am done with the accessing the mapped drive
at the first instant, and copied to local machine.
But how to restart the machine using script and if machine is
restarted manually just to check the script I am not able to access
the mapped drive as I will again have to give the userID and password.
That's the problem i am facing.

I mentioned the whole task to give the exact details of the restart
thing.
I thought like there will be some other way to do it easily. And i
don't want the whole script. I want the idea to approch in a easy
manner.

Re: how to do operation on a mapped drive

am 09.10.2007 10:09:13 von Joe Smith

andy wrote:

> No its not like that. I am done with the accessing the mapped drive
> at the first instant, and copied to local machine.
> But how to restart the machine using script ...

Sounds like you've never used the Search option on CPAN.

http://search.cpan.org/~jdb/Win32-0.32/Win32.pm
Win32::InitiateSystemShutdown(MACHINE, MESSAGE, TIMEOUT, FORCECLOSE, REBOOT)

> and if machine is restarted manually just to check the script

If you are debugging a script that only runs at startup or only
runs at login, you should have said so.

> I am not able to access
> the mapped drive as I will again have to give the userID and password.

Try select "Reconnect at login" when you map the drive and use the same
password for local login and for file server access. Or look at Map() in
http://search.cpan.org/~jenda/Win32-FileOp-0.14.1/FileOp.pm

-Joe