Jump to content

using secedit in a script


Recommended Posts

I need to run the following command as an administrator. I know how to do the runasset part but what I don't know is how to include the command using @comspec.

secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /quiet /areas USER_RIGHTS

That should be all one command. It is supposed to reset the security settings to ms defaults

Link to comment
Share on other sites

  • Developers

$rc = runwait(@comspec & " / c secedit.exe /configure /cfg " & @WindowsDir & "\repair\secsetup.inf /db secsetup.sdb /quiet /areas USER_RIGHTS")

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.
  :)

Link to comment
Share on other sites

$rc = runwait(@comspec & " / c secedit.exe  /configure /cfg " & @WindowsDir & "\repair\secsetup.inf /db secsetup.sdb /quiet /areas USER_RIGHTS")

<{POST_SNAPBACK}>

This still gives error message. Error: Unable to execute the external program. the system cannot find the file specified.
Link to comment
Share on other sites

  • Developers

This still gives error message.  Error:  Unable to execute the external program.  the system cannot find the file specified.

<{POST_SNAPBACK}>

Looks like i have a typo, there is a space between "/ c" ... try this version:

$rc = runwait(@comspec & " /c secedit.exe  /configure /cfg " & @WindowsDir & "\repair\secsetup.inf /db secsetup.sdb /quiet /areas USER_RIGHTS")

When it doesn't work you can check the following:

- is the secedit.exe in you standard seach path.. iow... can you runn it from the cmd prompt?

- run the above command with /k in stead of /c for testing. it will leave the cmd window open.

:ph34r:

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.
  :)

Link to comment
Share on other sites

Looks like i have a typo, there is a space between "/ c" ... try this version:

$rc = runwait(@comspec & " /c secedit.exe  /configure /cfg " & @WindowsDir & "\repair\secsetup.inf /db secsetup.sdb /quiet /areas USER_RIGHTS")

When it doesn't work you can check the following:

- is the secedit.exe in you standard seach path.. iow... can you runn it from the cmd prompt?

- run the above command with /k in stead of /c for testing. it will leave the cmd window open.

:ph34r:

<{POST_SNAPBACK}>

Thanks, That worked.
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...