Jump to content

Imort all Settings from a Registry-File


Recommended Posts

Hi Gurus,

I have a problem with the following code:

Run('"regedit /S " & @WorkingDir & "\Registry-Einstellungen\Software\ClearProg.reg"')

It appears a dialogbox with the following error:

Error: Unable to execute the external program

What's wrong? Please help me.

Thanks

Link to comment
Share on other sites

Do you mean @scriptdir, instead of @workingdir ?

I do not believe you need to wrap regedit /s in the inverted comma's either.

Consider trying it in a messagebox first, to show how it is interpreted.

Try this:

Run('regedit /S "' & @WorkingDir & '\Registry-Einstellungen\Software\ClearProg.reg"')
Link to comment
Share on other sites

Do you mean @scriptdir, instead of @workingdir ?

I do not believe you need to wrap regedit /s in the inverted comma's either.

Consider trying it in a messagebox first, to show how it is interpreted.

Try this:

Run('regedit /S "' & @WorkingDir & '\Registry-Einstellungen\Software\ClearProg.reg"')

<{POST_SNAPBACK}>

Many thanks...your code works great :)
Link to comment
Share on other sites

Ähm...I'm confused...

Dim $Reg
Dim $Search
Dim $File

; Alle reg-Dateien im spezifizierten Verzeichnis anzeigen.
$Search=FileFindFirstFile(@ScriptDir & "\Registry-Einstellungen\Test\*.reg")  

; Prüfen, ob die Suche erfolgreich ist.
If $Search=-1 Then
    MsgBox(0, "Error", "Keine Reg-Dateien gefunden!")
    Exit
EndIf

While 1
    $File=FileFindNextFile($Search) 
    If @error Then ExitLoop
    $Reg=@ScriptDir & "\Registry-Einstellungen\Test\" & $File
    RunWait('regedit.exe /S " & $Reg')
WEnd

; Handle schliessen.
FileClose($Search)

I have a problem with the runwait-function... :)

Please help me...

Edited by Starfighter
Link to comment
Share on other sites

  • Developers

Ähm...I'm confused...

    RunWait('regedit.exe /S " & $Reg')

<{POST_SNAPBACK}>

What editor are you using? with a proper editor that has syntax coloring you would get less confused with the string syntax...

Try:

RunWait('regedit.exe /S "' & $Reg & '"')
Edited by JdeB

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

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