Page 1 of 1
How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 14:50
by tomstealth
Hello virtualbox forums, I have successfully installed virtual windows xp on host windows xp. I have a shared folder set up which guest windows correctly mounts as a network drive. However this drive is not usable immediately as it needs double-clicking ie to be opened once. How can I force the folder to be accessible? At the moment, I have added a startup command line file that navigates to "Z:\" on login. Which actually works, except I don't know how to close the explorer window automatically now.
Can anyone provide any superior solutions? Thanks!
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 15:02
by vbox4me2
Make a .cmd file and place "dir z:\" in it, create a shortcut to this file and place it in your startup folder.
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 15:35
by tomstealth
Thanks a lot, I'll give it a go. Do I include the quotes, just in case someone answers before I try it?
Cheers!
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 15:49
by Perryg
No " " but when you create the shortcut make sure that the target says Z:\ and nothing else, the start in line should be blank. You can do this by right clicking the shortcut and left click on property.
One other thing that you might have missed (most do) when mounting the share in windows from the command line use net use (z: \\vboxsvr\sharename -p to make it persistent).
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 16:12
by tomstealth
Hmm. Tried with no " with no luck. Didn't check whether the shortcut points only to Z or not though. I believe the share is already persistent as it shows up every time without fail, it just shows 0 bytes until it's opened. Hmm.
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 16:20
by Perryg
the 0 bytes means that it is not mounted. run the mount with the -p. And the target must have the Z:\ only
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 16:23
by vbox4me2
You do not point or make a shortcut to Z:
You make a new file "dirzdrive.cmd" and place it into c:\
Then edit this file with notepad and place this line into it "dir z:\", hit save.
Click on this file once and select 'copy', then go to your startup folder and select 'paste as shortcut'.
Done, time to coffee, cake or icecream.
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 16:26
by tomstealth
Oh dear! I must admit I haven't RTFM. I got PerryG's thing working, except it still pops up with an explorer window on login, which is where I started! (Goes off to try other suggestion)
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 16:44
by tomstealth
Yep. Just create a file whatever.cmd, type "net use z: \\vboxsvr\sharename -p" without the quotes and save the file, copy and paste as a shortcut in startup programs, works every time, no problem, I'll read the manual next time, thanks very much!
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 17:36
by Perryg
If all you were trying to achieve here was to make the share accessible when you open your Guest you only need to run the command (z: \\vboxsvr\sharename -p) once. You do not need it in a startup script. the -p makes it persistent and will be available every time you open the guest.
Now if you want it to open the share to the desktop every time you need the script that vbox4me2 and I said (different commands same outcome).
Re: How to automatically have shared folders useable on login?
Posted: 23. Apr 2009, 22:31
by tomstealth
Well, I just want it so that when I have it setup for files to save to a shared folder from a guest, it doesn't give me loads of "folder or device not found" or whatever unless the share has been opened by explorer.. Which now doesn't happen. And also, there are no annoying folders everytime I start the virtual machine. I don't know whether because of the command being run once or the startup script, maybe I'll try without the script later to see if it still works.
The folder was already accessible before I got helped, it just was giving the above problems before.