Z
Zarborg
I'm writing a little program that will run when a user logs in, checks their
password expiration and also installs a piece of monitoring software if
necessary.
The program has to run on Vista so I got my first experience writing for UAC.
I've worked though the signed manifest and all the other little quirky stuff
I have to do to get my app to run as Administrator (System.DirectoryServices
said it required admin rights) and everything is working just dandy.
But, I would also like to map drives for the user as I do this. Problem is
that when I map the drive using the Admin split token privs, it actually maps
the drive for the admin user, not the lower priv user token. So I see that
it works, it reports that it works, even checking the existence of the drive
letter work but the drive letters don't show for the end user.
Now for the weird $50 question.
Is there a way while my program is running under the Admin token to execute
something as the user? Like open a cmd shell and run a simple net use
command?
I have this code running the mapping. Works great on XP, and works under
Vista but I just don't see the drives as the user on Vista. (comments
removed for space)
Dim myProcess As Process = New Process
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.Arguments = "/C net use K: \\vail\vmdk /persistent:no"
myProcess.Start()
myProcess.WaitForExit(10000)
If System.IO.Directory.Exists(strDrive) Then
txtStatus.Text = txtStatus.Text & "->Success "
Else
txtStatus.Text = txtStatus.Text & "->Failed "
End If
Really hoping that made sense....
password expiration and also installs a piece of monitoring software if
necessary.
The program has to run on Vista so I got my first experience writing for UAC.
I've worked though the signed manifest and all the other little quirky stuff
I have to do to get my app to run as Administrator (System.DirectoryServices
said it required admin rights) and everything is working just dandy.
But, I would also like to map drives for the user as I do this. Problem is
that when I map the drive using the Admin split token privs, it actually maps
the drive for the admin user, not the lower priv user token. So I see that
it works, it reports that it works, even checking the existence of the drive
letter work but the drive letters don't show for the end user.
Now for the weird $50 question.
Is there a way while my program is running under the Admin token to execute
something as the user? Like open a cmd shell and run a simple net use
command?
I have this code running the mapping. Works great on XP, and works under
Vista but I just don't see the drives as the user on Vista. (comments
removed for space)
Dim myProcess As Process = New Process
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.Arguments = "/C net use K: \\vail\vmdk /persistent:no"
myProcess.Start()
myProcess.WaitForExit(10000)
If System.IO.Directory.Exists(strDrive) Then
txtStatus.Text = txtStatus.Text & "->Success "
Else
txtStatus.Text = txtStatus.Text & "->Failed "
End If
Really hoping that made sense....