Author |
Topic  |
|
seven
Senior Member
   
USA
1037 Posts |
Posted - 10 March 2003 : 18:07:41
|
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
|
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 |
 |
|
seven
Senior Member
   
USA
1037 Posts |
Posted - 10 March 2003 : 18:19:44
|
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.
|
|
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 10 March 2003 : 18:55:20
|
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 |
 |
|
D3mon
Senior Member
   
United Kingdom
1685 Posts |
Posted - 10 March 2003 : 19:05:57
|
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" |
 |
|
seven
Senior Member
   
USA
1037 Posts |
Posted - 10 March 2003 : 19:13:01
|
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}]
|
|
 |
|
D3mon
Senior Member
   
United Kingdom
1685 Posts |
Posted - 10 March 2003 : 19:16:49
|
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 |
 |
|
seven
Senior Member
   
USA
1037 Posts |
Posted - 10 March 2003 : 21:07:35
|
works... thanks!
|
|
 |
|
D3mon
Senior Member
   
United Kingdom
1685 Posts |
|
|
Topic  |
|