![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Windows NT/2000/2003 Server/2008 Server Find support for Windows NT/2000/2003 Server/2008 Server editions. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Aug 2009
Posts: 1
OS: Win 2000
|
Writing to mapped drive while running as different user
Hi,
I am new to Windows. I have fair Linux knowledge. I have this following requirement. OS: Windows 2000 1) I will login as "administrator". I will be creating a mapped drive to map to some folder on another machine. Lets say I use "net use". 2) I have written another script/ program (in perl) which will just open a file on this mapped drive and write something to it. If file is not there, it will create it. 3) I have added a local user on this computer say "testuser". 4) Now I will be running this script as "testuser" using the runas command. say like this "runas /user:sandeep-w2k3\testuser "perl test.pl". it seems like the script seems to run. But I don't see anything being written to mapped drive. Neither the file is getting created. How to solve this problem. Pls help... Thanks in advance... Sandeep |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
TSF Enthusiast
Join Date: Mar 2009
Location: Portland, OR
Posts: 815
OS: MS-Dos 6.22 - Win7
|
Re: Writing to mapped drive while running as different user
Welcome to TSF!
Mapped drives are mapped on a per user basis. When using RunAs, they will not be available to the Script unless you load the user's profile and the drive has already been mapped while logged into that user's account. Even if you map the drive under the testuser account, and use the /profile switch, it may not work. I tried this: RunAs /profile /user:testuser "cmd /k" A command prompt opens, and net use shows the drive I mapped while logged into the testuser account, but lists it as unavailable. Sometimes I can access it, sometimes not. The best way would be to have the script map the drive, or access it using the UNC path. I don't know perl, so I can't help with that.
__________________
Microsoft MVP - Windows Desktop Experience Of course I know all the answers; I just don't always match the answers to the right questions. Rated R for Violence -- When your PC flies through a window, that's violent, right? |
|
|
|
![]() |
| Thread Tools | |
|
|