sarchs Posted May 4, 2011 Posted May 4, 2011 Hi Strange problem that is happening on our terminal server 2003 sp2 standard edition. When a user logs on a batch file runs mapping 3 networked drives. This seems to run correctly but only 1 or 2 driver show. I know the batch file works because i can go to the command promt and type net use, it then displays the 3 drives in the command window, but If i go to my computer they are not showing. Things i have tried; 1. Log off and back on as the same user - result all network drives now show 2. Clear that user profile and log on again - results in 1 or 2 mapped drives appearing 3. Log a user on, run task manager stop the explorer.exe and start the explorer.exe process - result all mapped drives appear 4. searched google tried to a patch but it says i am running the latest versions Here is what my batch file looks like @echo off net use s: \\server2\staffdrive$ /persistent:no net use m: \\server3\sme /persistent:no net use p: \\server3\Programs /persistent:no net time \\server /set /yes call \\server\Ranger\Utils\printers.bat Any suggestions Thanks
6Foot2 Posted May 4, 2011 Posted May 4, 2011 We use fully qualified domain names. Would it help you if you did the same? @echo off net use s: \\server2.domain.local.domain.local\staffdrive$ /persistent:no net use m: \\server3.domain.local.domain.local\sme /persistent:no net use p: \\server3.domain.local.domain.local\Programs /persistent:no net time \\server.domain.local /set /yes call \\server.domain.local\Ranger\Utils\printers.bat
Steve21 Posted May 4, 2011 Posted May 4, 2011 I'd suggest it's because you're running the bat elevated? If so, sometimes it won't show the files to "normal" users. (Ignoring the fact this link is to Vista, same applies) After you turn on User Account Control in Windows Vista, programs may be unable to access some network locations Simple way to try it is mapping it, as a non elevated account and seeing if you can access it? Steve
sarchs Posted May 4, 2011 Author Posted May 4, 2011 (edited) Tried that now davep and no difference. Thanks Edited May 4, 2011 by sarchs
sarchs Posted May 4, 2011 Author Posted May 4, 2011 I'd suggest it's because you're running the bat elevated? If so, sometimes it won't show the files to "normal" users. (Ignoring the fact this link is to Vista, same applies) After you turn on User Account Control in Windows Vista, programs may be unable to access some network locations Simple way to try it is mapping it, as a non elevated account and seeing if you can access it? Steve I have tried to map it logged on as a user and the drive appears already mapped in the map network drive window but it wont let me add it again
reggiep Posted May 6, 2011 Posted May 6, 2011 How about running a line to delete the connections before the line to connect them? I'm not sure of the syntax exactly as we use kixtart scripting but we had a similar issue so we ran a command to disconnect first. I think it would be something like net use s: /DELETE /persistent:no
SkreeM1980 Posted May 11, 2011 Posted May 11, 2011 net use s: /DELETE /persistent:no Isn't quite right. From memory it is Net use S: /Delete /Yes [/Code] But that would need to be for each mapping ... you could also use [code] net use * /delete /yes at the top of the batch file. Skr
TheMan100 Posted May 11, 2011 Posted May 11, 2011 What about just adding... TASKKILL /F /IM "explorer.exe" explorer.exe ...to your batch file, maybe not the best solution, but if stopping and restarting explorer works, this should do.
Montgomery_Minds Posted February 19, 2015 Posted February 19, 2015 4 year old post, but... I just had this problem today, and tried the priv tip twice, and it worked. It is consistent--at least on my system at this time. Which is windows 7 sp1. details: elevated cmd prompt net use x: \\nodename\c can only be seen in elevated cmd prompt. not in non-elevated cmd prompt. not in explorer. (oddly, not even elevated explorer, ) non-elevated cmd prompt net use x: \\nodename\c can be seen in non-elevated cmd prompt. and for some reason i can not fathom, can NOT be seen in elevated cmd prompt. What is the possible rationale that an elevated cmd prompt cant use a non-elevated mapped drive? That you'll accidentally do something privileged on it? smh. And it can also be viewed in explorer elevated, and non-elevated. similarly, map network driver in explorer CAN be seen in non-elevated cmd prompt net use can NOT be seen in elevated cmd prompt net use Which is maddeningly frustrating cuz i need that often...
Montgomery_Minds Posted February 20, 2015 Posted February 20, 2015 I did some more research on elevated and non-elevated drive mappings. The KB referenced above by @sarchs explains it, but there's more here: Mapped drives (incl net use) missing from elevated processes eg UAC cmd run as administrator | Montgomery Minds Including a link to a technet article which is IMHO better and has some hi quality comments that add: Some Programs Cannot Access Network Locations When UAC Is Enabled Now the KB says this will fix it net use \\\ /user: I just tried this and it did not make the \\COMPUTERNAME\SHARENAME appear in the other net use listing. Now it's possible that even tho it did not appear in the net use listing, it did log me in in both prived and non-prived. I did not test this, cuz i i was already logged in in both and so it requires logging out to test and i cant do that right now for other reasons.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now