jonabyte Posted January 5, 2006 Share Posted January 5, 2006 Hello, I am using the following script with no luck ; Set the RunAs parameters to use local adminstrator account RunAsSet("Administrator", @ComputerName, "password") ; Run registry editor as admin RunWait("wscript.exe ""\\server\company\server.vbs") ; Reset user's permissions RunAsSet() This script is called from their loginscript, the autoit exe and vbs script are located in the same folder. I have checked the username and password over and over but I get an error stating that "the username couild not be found or bad password". Any ideas, this script is from the help file. Thanks Link to comment Share on other sites More sharing options...
BigDod Posted January 5, 2006 Share Posted January 5, 2006 Hello, I am using the following script with no luck ; Set the RunAs parameters to use local adminstrator account RunAsSet("Administrator", @ComputerName, "password") ; Run registry editor as admin RunWait("wscript.exe ""\\server\company\server.vbs") ; Reset user's permissions RunAsSet() This script is called from their loginscript, the autoit exe and vbs script are located in the same folder. I have checked the username and password over and over but I get an error stating that "the username couild not be found or bad password". Any ideas, this script is from the help file. ThanksShould this line RunWait("wscript.exe ""\\server\company\server.vbs") Not be RunWait("wscript.exe " & "\\server\company\server.vbs") Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
jonabyte Posted January 5, 2006 Author Share Posted January 5, 2006 That did not fix the error message, thanks anyways. But I remember now that the error message stated; "Logon Failure: the username could not be found or bad password". Should this line RunWait("wscript.exe ""\\server\company\server.vbs") Not be RunWait("wscript.exe " & "\\server\company\server.vbs") Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 That did not fix the error message, thanks anyways. But I remember now that the error message stated; "Logon Failure: the username could not be found or bad password".even if it didn't fix the issue you're having NOW, his observation was correct and will help you avoid a different issue once you get this one fixed. one thing you can do, is have the data you're passing put into the clipboard, then do a manual "run as" and paste the values in. i bet you'll get the same error message. one thing that looks funny is that you're using a local administrator account to access a network share... Link to comment Share on other sites More sharing options...
jonabyte Posted January 5, 2006 Author Share Posted January 5, 2006 even if it didn't fix the issue you're having NOW, his observation was correct and will help you avoid a different issue once you get this one fixed. one thing you can do, is have the data you're passing put into the clipboard, then do a manual "run as" and paste the values in. i bet you'll get the same error message. one thing that looks funny is that you're using a local administrator account to access a network share...yes I noticed that too, so I just changed the script to access the vbs script locally and had the same problem with the same error. Link to comment Share on other sites More sharing options...
jonabyte Posted January 5, 2006 Author Share Posted January 5, 2006 yes I noticed that too, so I just changed the script to access the vbs script locally and had the same problem with the same error.Well I believe I have solved this issue, I need to change the admin password on the local computer to the same as the one on the server. I am assuming because the script uses the user/pass from autoit to access the script AND the vbs script is accessing items from that server. Hope that makes sense.Thanks Link to comment Share on other sites More sharing options...
objectivescott Posted January 5, 2006 Share Posted January 5, 2006 (edited) This works for me. I think your problem is that the RUNASSET user id that you're using doesn't have access to your VBS file. You shouldn't have to modify any local account passwords to get this working. I am assuming, of course that this is a windows domain and that the server is a member of such domain.-ScottWell I believe I have solved this issue, I need to change the admin password on the local computer to the same as the one on the server. I am assuming because the script uses the user/pass from autoit to access the script AND the vbs script is accessing items from that server. Hope that makes sense.Thanks Edited January 5, 2006 by objectivescott Link to comment Share on other sites More sharing options...
Anaxibius Posted January 5, 2006 Share Posted January 5, 2006 Well I believe I have solved this issue, I need to change the admin password on the local computer to the same as the one on the server. I am assuming because the script uses the user/pass from autoit to access the script AND the vbs script is accessing items from that server. Hope that makes sense.ThanksI had all sorts of problems with RunAsSet and invariably they were caused by me. If you have a script that runs locally that needs access to a server resource it will not function unless the account you use has access to that resource. I would recommend using a domain admin account or something along those lines. Basically you need an account that has admin rightson the local machine and the server you are trying to access from the vbs script. 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