Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Mapping a drive in W2K (only if available)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

seven
Senior Member

USA
1037 Posts

Posted - 10 March 2003 :  18:07:41  Show Profile  Visit seven's Homepage
Is there a way to write script of some sort to map a drive in Windows 2000 only if it is available?
I have 2 PC's networked via a router, and want to map the drive of the second PC on the first only when it is available (turned on)

I am trying to avoid those annoying "can not connect" messages when I login to windows and the second PC is turned off.


DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 March 2003 :  18:13:11  Show Profile
Doubt it, ASP can't access Windows API without the use of COM components inbetween, and ASP can't acces network drives anyway.

The UK MkIVs Forum
Go to Top of Page

seven
Senior Member

USA
1037 Posts

Posted - 10 March 2003 :  18:19:44  Show Profile  Visit seven's Homepage
I really didn't mean in ASP... bat file, whatever... not forum related.

quote:
Originally posted by DavidRhodes

Doubt it, ASP can't access Windows API without the use of COM components inbetween, and ASP can't acces network drives anyway.


Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 10 March 2003 :  18:55:20  Show Profile  Visit dayve's Homepage
example mapping a sample drive letter z:

net use z: \\servername\sharename

here is the net use help


NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]
        [/USER:[domainname\]username]
        [/USER:[dotted domain name\]username]
        [/USER:[username@dotted domain name]
        [[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]




Edited by - dayve on 10 March 2003 18:56:40
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 10 March 2003 :  19:05:57  Show Profile  Visit D3mon's Homepage
Somewhere (he says, desperately trying to remember back two years to his last IT job) there is an option to tell the system not to try to reconnect mapped network drives until they are actually required (i.e. when you click on its icon)


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

seven
Senior Member

USA
1037 Posts

Posted - 10 March 2003 :  19:13:01  Show Profile  Visit seven's Homepage
That's how I do it now... but if the other PC is not on... I get an error.


quote:
Originally posted by dayve

example mapping a sample drive letter z:

net use z: \\servername\sharename

here is the net use help


NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]
        [/USER:[domainname\]username]
        [/USER:[dotted domain name\]username]
        [/USER:[username@dotted domain name]
        [[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]





Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 10 March 2003 :  19:16:49  Show Profile  Visit D3mon's Homepage
Ah sorry, I thought you meant a drive mapping within Windows itself.

If you want to do it via a .bat file, you could put a control file in the mapped folder on the other machine and check for its presence before running net use:

Like (again, haven't done this for a while):

If exists \\othermachine\otherfolder\islive.txt then
net use blah...

It will go onto the network and look for the file on the other machine - if (and only if) it finds it, it maps it.

The Syntax may not be correct but I know you can do it that way.

Edited by - D3mon on 10 March 2003 19:22:15
Go to Top of Page

seven
Senior Member

USA
1037 Posts

Posted - 10 March 2003 :  21:07:35  Show Profile  Visit seven's Homepage
works... thanks!

Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 11 March 2003 :  05:05:47  Show Profile  Visit D3mon's Homepage
quote:
Originally posted by airilm

works... thanks!



Sweeet!


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07