Jump to content

Cannot start msconfig withi autoit


Recommended Posts

While Richard is searching, and I hope he finds it, if this is Win 7 64 bit; what happens when you click the start button and type msconfig in the search field? Does it find the file? If yes; right-click on it and select "Open File Location" to be sure of where it is. Probably system32 folder (@SystemDir on 32 bit). Since that is in the Windows path you don't have to enter the path anyway. Now to the part that may be messing you up; I seem to recall that you need Admin privileges to use MSConfig so you may have to use RunAs().

This code works for me every time but then again I have Admin privileges as the only user.

$sTitle = "System Configuration"
ShellExecute("msconfig", -2)
WinWaitActive($sTitle)
ControlClick($sTitle, "", "[CLASSNN:Button5]", "primary");;  Check the "Safe Boot" box
ControlClick($sTitle, "", "[CLASSNN:Button8]", "primary");; Button6 for Minimal, Button7 for Alternate Shell, Button8 for AD Repair, Button9 for Network
Sleep(10000);; give it time to display for testing only
;ControlClick($sTitle, "", "[CLASSNN:Button32]", "primary");; You might need to click "Apply" here
ControlClick($sTitle, "", "[CLASSNN:Button31]", "primary");; Change to Button30 for "OK"

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Moderators

There's gotta be a way to restart into safe mode without that program though. I'm currently researching it.

My reply really has nothing to do with "safe mode". I was merely addressing the "Run" issue.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

On WinXp this script will set the parameter in the boot.ini so the next time you reboot it goes directly to safe mode. However, in safe mode you must uncheck from the msconfig GUI, or you will constantly boot into safe mode.

Maybe the same behavior will persist in 7

$BootWrite = fileopen ("c:\boot.ini" , 1)

FileWrite ($BootWrite , " /safeboot:network")

FileClose ($BootWrite)

exit
Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

yeah, my bad. some bcdedit action, then?

bcdedit /set safeboot minimal

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

  • 3 years later...

MaxuN posted this

to try this:

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

so I did and it worked finally thanks to MaxuN

my code was:

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

ShellExecute(@WindowsDir & "System32msconfig.exe")

Link to comment
Share on other sites

  • Moderators

Did you see that this post is 3 years old, and the OP has not been active since the thread was started?? Please don't necro old posts; the language has grown a lot since 2011. If you have a question, please post a new thread, and describe in detail what you are trying to do.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...