Adding A Folder To 'Run As' In Windows XP

You can't really 'run' a folder like an application with administrative rights, so some modifications are necessary.

Create a vbscript to do the job. Open Notepad and copy paste the following.

'grab the username
sUsername = InputBox("Enter Username")
'create a shell command object
set oCmd = createobject("Wscript.Shell")
'Build the runas string passing the folder name to explorer.exe
sCmd = "runas /u:" & sUsername & " " & chr(34) & "explorer " & wscript.arguments(0) & chr(34)
'Run the command
oCmd.run sCmd


Save it in your c:\documents and settings\%username%\sendto folder (show hidden files and folders to see this folder) with vbs extension. Now when you right-click the folder, you should see your script under the 'Send To' context menu. If you select it, you'll get an inputbox prompt for the username, a dos prompt for the password, and it should open the folder using that user's credentials for you. Its not direct but works.

No comments:

Post a Comment

Post a Comment