I currently use mounted drives to access my network shares because I want the ability to limit access to the files without having to logout and relogin everytime I make a change.
I am interested to find out what other options there are to accomplish this same task. I use vista32 for my HTPC and Ubuntu Linux for my server (running Samba).
What I currently do is:
I have a login on my HTPC called “theater” (no quote obviously). On my server I have two users setup (others too…but for this example, I will keep it to two). They are: “theater” (with the same password as the user on the HTPC) and “theater-admin” (with its own password of course).
I have two shares setup on the server, each sharing the same folder. One is called VideoRead and the other is called VideoWrite. VideoRead is read only for all users and VideoWrite allows full control to user “theater-admin”.
When “theater” logs in to the HTPC, I have a batch file run that does this:
If Exist v: (
net use v: /delete
) net use v: \UBUNTU\VideoRead
If Exist x: (
net use x: /delete
) net use x: \192.168.1.220\WriteVideo /u:theater-admin “password”
“password” is of course of the password that user. The IP address is the IP address of my server UBUNTU. The reason for this is that Windows will not allow you to connect to the same server with multiple credentials (at least that is what I have read and the only way I could get it to work) but using the IP is kind of a workaround and it “thinks” it is a different server.
What this does is give user theater read-only access to the files (through drive V:, which is not really necessary…since it would have readonly access via the UNC anyway). But, it also give user theater write access via drive X: without every logging out.
So, the wife and kids use the shortcuts I have setup for V: and Mediabrowser uses V:, but when I want to write something I use X: (for example, metabrowser points to X:).
This works great…but of course I am still bound to the mapped drives and would love to just be able to use the UNC directly…but could not figure out how.
As an aside, I have 5 servers setup on my network…3 of them are setup this way. The other two I use in different capacities so it is not relevant.
Here’s hopeing someone has a better solution?
Oh, this one is easy I think. It looks to me like you only need the last net use command. Try this on a test machine:
Edit your login batch program to only include:
You're done. :)
Now you don’t have to worry about disconnected drives and Media Browser only has read access to your titles. But, when you get ready to change something, you just double click the shortcut on your desktop point to your WRITE share.
Just want to state, you WILL LOSE your playstates for your titles by moving to UNC paths for all your configurations. It might even invalidate the cache on each machine as well. Also note that you are correct in that windows does not allow same/different users to the same resource. Why, when the share names are totally different, it does this I'll never know. However, using mapped drives did not solve that problem for you. The fact that you used IP address in one net use command and the Host name in another is what solves it, which is why you only need the one net use statement for admin.
I also wanted to add another tip to this. As discussed, the limitation to being able to use only one account to access a shared resource is overcome by using the IP address to authenticate to the second share. However that only allows you to do this for two accounts. But, there is also a workaround for this. If you have a DNS server, add an alias for the target. If you only have a home lan setup (typical), then add new host entries to the HOSTS file on each client like so:
192.168.1.103 home-serverRead 192.168.1.103 home-serverWrite 192.168.1.103 home-serverSuperUser
This “tricks” windows into thing you're using a different name for each account. Again, why you have to jump through hoops to do this in windows, I'll never know.
Hmmm…I had no idea you could use Net Use like that without mapping it to a drive letter. I will give it a try and post back.
By the way…you mentioned (in the other thread) that you use a login schedule to run the .bat file. I am using startup, but sometimes this is a problem as it runs to early and the NET USE commands hang for a while (no ability to put a “wait” statement in a batch file). Can you explain how you have that setup?
Works slicker than cow slobber!
I knew the solution was because of the IP address vs. server name, but I did not know that NET USE didn’t require a drive letter.
The part about losing playstates is a bummer…but I guess that’s not that big a deal to fix (I don’t use the watched counter for movies anyway…just TV shows).
I think I will wait until the next version of MB to make the switch…do it all at once.
Let me know about how you schedule the login bat file…I am interested to see if getting it out of startup is worth while.
Thanks for the help. I appreciate it!