Mapped drive needs to be "activated"
-
- 5StarLounger
- Posts: 1120
- Joined: 26 Jan 2010, 11:32
- Location: "What a mighty long bridge to such a mighty little old town"
Mapped drive needs to be "activated"
Hi guys,
I have a NSLU2 (uNslung) attached to a harddrive for external storage. This is mapped to a drive letter on my Windows XP SP3 main PC and the OH laptop (OS as main PC). This all works great as external storage if we use Windows explorer to Open the drive. If we don't double click the drive, backup programs (Karen's Replicator on the laptop and Ceren Backup on main PC) don't see the drive.
Does anyone know of a way to "activate" a mapped drive at bootup, so that we don't have to remember (old brains, losing brain cells daily - desperately need a memory upgrade ) to open the drive before scheduled backup time?
I have a NSLU2 (uNslung) attached to a harddrive for external storage. This is mapped to a drive letter on my Windows XP SP3 main PC and the OH laptop (OS as main PC). This all works great as external storage if we use Windows explorer to Open the drive. If we don't double click the drive, backup programs (Karen's Replicator on the laptop and Ceren Backup on main PC) don't see the drive.
Does anyone know of a way to "activate" a mapped drive at bootup, so that we don't have to remember (old brains, losing brain cells daily - desperately need a memory upgrade ) to open the drive before scheduled backup time?
John
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
-
- Administrator
- Posts: 12856
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Mapped drive needs to be "activated"
Would a little .BAT file in your Startup folder, that just gets a directory listing of the top folder on the drive work?
StuartR
-
- 5StarLounger
- Posts: 1120
- Joined: 26 Jan 2010, 11:32
- Location: "What a mighty long bridge to such a mighty little old town"
Re: Mapped drive needs to be "activated"
That's a good idea, I could always direct output to null to avoid a popup window hanging about (this is the main reason I don't just stick a shortcut to the drive in startup)StuartR wrote:Would a little .BAT file in your Startup folder, that just gets a directory listing of the top folder on the drive work?
Something like
Code: Select all
@echo off
dir y: > nul
exit
should do don't you think? I'll try that tomorrow.
John
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
-
- PlatinumLounger
- Posts: 5534
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Mapped drive needs to be "activated"
You could make that a one-liner: since EXIT is redundant in that situation! That's unless you also want to be sure it's there...
DIR is a more reliable way of checking that a drive is available rather than IF EXIST <filename>. I have set up backups from server to TrueCrypt-ed PC hard disk partitions, and check that the TrueCrypt MOUNT command has worked by doing a DIR of the drive letter and checking for a zero errorlevel.
Code: Select all
@dir y: > nul
DIR is a more reliable way of checking that a drive is available rather than IF EXIST <filename>. I have set up backups from server to TrueCrypt-ed PC hard disk partitions, and check that the TrueCrypt MOUNT command has worked by doing a DIR of the drive letter and checking for a zero errorlevel.
John Gray
A car crashed into a barrier at speed; nobody was injured, but a front wheel became detached, and slowly rolled down the road.
Driver [sings]: "You picked a fine time to leave me, Loose Wheel"
A car crashed into a barrier at speed; nobody was injured, but a front wheel became detached, and slowly rolled down the road.
Driver [sings]: "You picked a fine time to leave me, Loose Wheel"
-
- 5StarLounger
- Posts: 1120
- Joined: 26 Jan 2010, 11:32
- Location: "What a mighty long bridge to such a mighty little old town"
Re: Mapped drive needs to be "activated"
Ok, John and Stuart (and unseen audience)
I've tried the batch file suggested, (neat one-liner by the way, it's been too long since I had to DOS it) but until the Drive has been opened by explorer all I get is "system cannot find path specified".
I can do a
which does open the Y: drive window (then the batch file is redundant) but then I have to manually close the window. I don't mind this but other people in the house (and they know who they are...) will object.
Any suggestions for opening then closing the window without anyone (her) seeing it?
I've tried the batch file suggested, (neat one-liner by the way, it's been too long since I had to DOS it) but until the Drive has been opened by explorer all I get is "system cannot find path specified".
I can do a
Code: Select all
Explorer /root,y:
Any suggestions for opening then closing the window without anyone (her) seeing it?
John
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
-
- Administrator
- Posts: 12856
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Mapped drive needs to be "activated"
Strange.jonwallace wrote:...until the Drive has been opened by explorer all I get is "system cannot find path specified"...
You could try a command like
Code: Select all
NET USE \\computer\ipc$
Code: Select all
NET USE G: \\computer\share
Try each of these commands in the BAT file before the DIR and see if they do the trick.
StuartR
-
- 5StarLounger
- Posts: 1120
- Joined: 26 Jan 2010, 11:32
- Location: "What a mighty long bridge to such a mighty little old town"
Re: Mapped drive needs to be "activated"
Thanks for the suggestion, I'll give those a go tomorrow.
John
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
-
- 5StarLounger
- Posts: 1120
- Joined: 26 Jan 2010, 11:32
- Location: "What a mighty long bridge to such a mighty little old town"
Re: Mapped drive needs to be "activated"
Thanks guys ,
the NET USE G: \\computer\share bit looks like the command to do the trick, especially when I remember to put quotes round the path with a space in it.
I'll incorporate it into a BAT file with a @ at the start and a >nul at the end to make it silent (that will make it silent, won't it?)
the NET USE G: \\computer\share bit looks like the command to do the trick, especially when I remember to put quotes round the path with a space in it.
I'll incorporate it into a BAT file with a @ at the start and a >nul at the end to make it silent (that will make it silent, won't it?)
John
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
-
- Administrator
- Posts: 12856
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Mapped drive needs to be "activated"
To make a BAT file silent you should havejonwallace wrote:...a BAT file with a @ at the start and a >nul at the end to make it silent (that will make it silent, won't it?)
@echo Off
as the first line
Ah, I have just understood, you want to direct any output to the null device, so the >NUL is not at the end of the BAT file, it is at the end of the command that runs the bat file.
StuartR
-
- PlatinumLounger
- Posts: 5534
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Mapped drive needs to be "activated"
The @ at front of the command will make that command silent, but not the whole BATch file.jonwallace wrote:the NET USE G: \\computer\share bit looks like the command to do the trick, especially when I remember to put quotes round the path with a space in it.
I'll incorporate it into a BAT file with a @ at the start and a >nul at the end to make it silent (that will make it silent, won't it?)
To be really, really, sure that the command will produce no output, you should put
1>nul 2>&1
at the end, but that means you would never see any error message (stream 2).
John Gray
A car crashed into a barrier at speed; nobody was injured, but a front wheel became detached, and slowly rolled down the road.
Driver [sings]: "You picked a fine time to leave me, Loose Wheel"
A car crashed into a barrier at speed; nobody was injured, but a front wheel became detached, and slowly rolled down the road.
Driver [sings]: "You picked a fine time to leave me, Loose Wheel"
-
- 5StarLounger
- Posts: 1120
- Joined: 26 Jan 2010, 11:32
- Location: "What a mighty long bridge to such a mighty little old town"
Re: Mapped drive needs to be "activated"
Update:
Does what I want for the moment. I haven't tried to trap for failure of the command, because frankly, the "customer" (the wife) doesn't want to be bothered with failed DOS boxes hanging around
Thanks again for the help guys, saved me going in the loft for my DOS books
Code: Select all
@NET USE G: \\computer\share > nul
Thanks again for the help guys, saved me going in the loft for my DOS books
John
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
-
- 5StarLounger
- Posts: 1120
- Joined: 26 Jan 2010, 11:32
- Location: "What a mighty long bridge to such a mighty little old town"
Re: Mapped drive needs to be "activated"
Final update: I was wrong about the code above. It worked on my wired PC, but on her wireless laptop, it failed because it tried to connect before the network connection was ready.jonwallace wrote:Update:Does what I want for the moment.Code: Select all
@NET USE G: \\computer\share > nul
I hopped over here and following advice I ended up with this BAT file
Code: Select all
@Echo Off
:CheckNet
ping -n 1 -w 1000 www.google.co.uk |find /I "Reply"
If %Errorlevel%==1 goto CheckNet
NET USE G: \\computer\share > nul
John
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube
“Always trust a microbiologist because they have the best chance of predicting when the world will end”
― Teddie O. Rahube