Jump to content
Sign in to follow this  
ajfoster

using secedit in a script

Recommended Posts

ajfoster

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

Share this post


Link to post
Share on other sites
Jos

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ajfoster

$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.

Share this post


Link to post
Share on other sites
Jos

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:


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ajfoster

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.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.