MikahS Posted August 20, 2014 Posted August 20, 2014 (edited) Muzaiyan the OP is trying to run this from a non-admin domain profile; essentially you cannot use that as you would not be able to run the script with: #requireAdmin IsAdmin Edited August 20, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
itye1970 Posted August 20, 2014 Author Posted August 20, 2014 i get the message the script is running with admin rights but then it still just hangs on the command line C:\Windows\System32\ command prompt
MikahS Posted August 20, 2014 Posted August 20, 2014 Did you try specifying the full path instead of just the program name with the cmd param? Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
Developers Jos Posted August 20, 2014 Developers Posted August 20, 2014 ok now it opens a command window with the cursor at C:\Windows\System32\ and nothing happens What should it do? (Can't test this on my setup) What happens when you type the commandline manually like this: bitlockerwizardelev.exe " u" in the opened window? You could also try this format: Local $iPID = RunAs($sUserName, @ComputerName, $sPassword, 0, @comspec & ' /k bitlockerwizardelev.exe \ u', "", @SW_SHOWMAXIMIZED) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
itye1970 Posted August 20, 2014 Author Posted August 20, 2014 What should it do? (Can't test this on my setup) What happens when you type the commandline manually like this: bitlockerwizardelev.exe " u" in the opened window? You could also try this format: Local $iPID = RunAs($sUserName, @ComputerName, $sPassword, 0, @comspec & ' /k bitlockerwizardelev.exe \ u', "", @SW_SHOWMAXIMIZED) Ive only got one post left, its supposed to open a password reset screen for users to allow them to change their bitlocker password
Developers Jos Posted August 20, 2014 Developers Posted August 20, 2014 Ive only got one post left, Should be OK now. its supposed to open a password reset screen for users to allow them to change their bitlocker password So what happened with the other 2 questions? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
itye1970 Posted August 20, 2014 Author Posted August 20, 2014 Should be OK now. So what happened with the other 2 questions? doesnt work nothing happens , it runs from command prompt manually but not from autoit script. any more ideas or has this got you all thinking :-)
MikahS Posted August 20, 2014 Posted August 20, 2014 Its hard to guess when we don't have all the information. Post the most recent script used inside autoit tags or using the code editor in the comment menu. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
Developers Jos Posted August 20, 2014 Developers Posted August 20, 2014 doesnt work nothing happens , it runs from command prompt manually but not from autoit script. any more ideas or has this got you all thinking :-) The question was what happens when you manually run the command from the window opened by the script? Just want to get confirmation that works too when running under different credential. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
itye1970 Posted August 21, 2014 Author Posted August 21, 2014 The question was what happens when you manually run the command from the window opened by the script? Just want to get confirmation that works too when running under different credential. Jos Nothing happens
itye1970 Posted August 21, 2014 Author Posted August 21, 2014 try also _RunDos() direct from example: #include <Process.au3> Local $rc = _RunDos("start Http://www.autoitscript.com") run your program on DOS prompt your code works but when i replace it with Local $rc = _RunDos(""C:\Windows\System32\bitlockerwizardelev.exe u"") nothing happens
Developers Jos Posted August 21, 2014 Developers Posted August 21, 2014 Nothing happens If manually nothing happens then I am not sure what you expect from a script? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
itye1970 Posted August 21, 2014 Author Posted August 21, 2014 i worked it out myself, basically created a cmd file with the parameters and called that cmd file instead from autoit, looks like a bug in autoit not accepting parameters with a space
MikahS Posted August 21, 2014 Posted August 21, 2014 I doubt it's a bug in Autoit, instead its more or less debugging that hasn't been done Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
Muzaiyan Posted August 21, 2014 Posted August 21, 2014 Local $iPID = RunAs($sUserName, @ComputerName, $sPassword, 0, 'bitlockerwizard.elev "\ u"', "", @SW_SHOWMAXIMIZED) this code works fine but you should try this one: Local $Program = "bitlockerwizardelev.exe" Local $parms = '\ U' Local $sUserName = "" Local $sPassword = "" ; try all flags one by one Local $flags = 0 ;~ $flags = 1 ;~ $flags = 2 ;~ $flags = 4 If Not FileExists(@SystemDir & "\" & $Program) Then MsgBox(16, "(File Not Found)", "Please Check The Existance of file.") Local $iPID = RunAs($sUserName, @ComputerName, $sPassword, $flags, @ComSpec & " /C " & $Program & " " & $parms, @SystemDir, @SW_SHOWMAXIMIZED) If @error Then MsgBox(16, "ERROR: " & @error, "Process failed") If StringRight($Program, 4) <> ".exe" Then MsgBox(16, "", "Please make sure that file is an executable or use ShellExecute() function") EndIf
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