Davidz39 Posted January 4, 2009 Share Posted January 4, 2009 My daughter got a new nancy drew game for christmas. The issue is that the game requires an admin account to run and she uses a limited account on windows XP. Currently, when she wants to play the game, we parents right click the icon and do a runas and then type in our username/password. I was hoping to automate this so she could play it at anytime. To this end, I downloaded and tried to create script to do this. Sadly, my little .exe file does nothing. No errors, no program, no nothing. I'm hoping someone can help me out. The help file example doesn't help, I've also spent time browsing the example scripts, but they are all much more complicated than what I need. Here is the script I tried to use(The Username, Password and the DOMAIN values have been changed to protect the innocent! This PC is not on a domain, but is in a workgroup): ----------------------------------------------- Local $sUserName = "USERNAME" Local $sPassword = "PASSWORD" ; Run a command prompt as the other user. RunAs($sUserName, "WORKGROUPNAME", $sPassword, 0, "Game.exe", "C:\Program Files\Nancy Drew\Message in a Haunted Mansion\") ----------------------------------------------- If someone could please help me with this it would be MUCH appreciated! Link to comment Share on other sites More sharing options...
muncherw Posted January 4, 2009 Share Posted January 4, 2009 Try this: Local $sUserName = "USERNAME" Local $sPassword = "PASSWORD" ; Run a command prompt as the other user. RunAs($sUserName, "WORKGROUPNAME", $sPassword, 0, "C:\Program Files\Nancy Drew\Message in a Haunted Mansion\Game.exe", "C:\Program Files\Nancy Drew\Message in a Haunted Mansion\") Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 4, 2009 Share Posted January 4, 2009 My daughter got a new nancy drew game for christmas. The issue is that the game requires an admin account to run and she uses a limited account on windows XP. Currently, when she wants to play the game, we parents right click the icon and do a runas and then type in our username/password. I was hoping to automate this so she could play it at anytime. To this end, I downloaded and tried to create script to do this. Sadly, my little .exe file does nothing. No errors, no program, no nothing. I'm hoping someone can help me out. The help file example doesn't help, I've also spent time browsing the example scripts, but they are all much more complicated than what I need. Here is the script I tried to use(The Username, Password and the DOMAIN values have been changed to protect the innocent! This PC is not on a domain, but is in a workgroup): ----------------------------------------------- Local $sUserName = "USERNAME" Local $sPassword = "PASSWORD" ; Run a command prompt as the other user. RunAs($sUserName, "WORKGROUPNAME", $sPassword, 0, "Game.exe", "C:\Program Files\Nancy Drew\Message in a Haunted Mansion\") ----------------------------------------------- If someone could please help me with this it would be MUCH appreciated! Workgroups do not contain any authentication mechanism. They are joined and listed by a NetBIOS broadcast mechanism, with no authentication required (as opposed to a domain). The username and password are actually in the context of the local computer, so use the @ComputerName macro: Local $sUserName = "USERNAME" Local $sDomainName = @ComputerName Local $sPassword = "PASSWORD" Local $sGameDir = "C:\Program Files\Nancy Drew\Message in a Haunted Mansion" Local $sGameExe = $sGameDir & "\Game.exe" ; Run a command prompt as the other user. RunAs($sUserName, $sDomainName, $sPassword, 0, $sGameExe, $sGameDir) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Davidz39 Posted January 4, 2009 Author Share Posted January 4, 2009 That fixed it, thanks alot! Link to comment Share on other sites More sharing options...
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