Sign in to follow this  
Followers 0
microbious

how to save registry keys to file.reg ?

14 posts in this topic

i cant find anything on forum or in help file.

Searched for over 20 minutes (thats allot of time wasting could be used for coding other things)

Thanks allot

Share this post


Link to post
Share on other sites



Or use custom function:

Func _RegExport($sKeyName, $sValueName, $sRegFile)
    Local $sRegRead = RegRead($sKeyName, $sValueName)
    Local $hOpen = FileOpen($sRegFile, 2)
    
    FileWrite($hOpen, 'Windows Registry Editor Version 5.00' & @CRLF & @CRLF & _
            "[" & $sKeyName & "]" & @CRLF & _
            '"' & $sValueName & '"="' & StringRegExpReplace($sRegRead, '([\\"])', '\\\1') & '"' & @CRLF)
    
    FileClose($hOpen)
EndFunc

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

CMD

RunWait('"' & @ComSpec & '" /c REGEDIT /E G:\Autoit\reg.reg HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run', '', @SW_HIDE)

saveto : G:\Autoit\reg.reg

key : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

Edited by DCCD

Share this post


Link to post
Share on other sites

Thank you all for your help.

i will try tomorrow.

Good night

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

found another way:

Run (@WindowsDir & '\regedit.exe /E "file.reg" "KEY"')

Tanks

Autoit can install services right ?

Any idea how ?

I could use instsrv.exe 'service name' but i would have to include it in the script and this file treated as virus by most antivirus programs

Edited by lessstoopid

Share this post


Link to post
Share on other sites

found another way:

Run (@WindowsDir & '\regedit.exe /E "file.reg" "KEY"')

Tanks

Autoit can install services right ?

Any idea how ?

I could use instsrv.exe 'service name' but i would have to include it in the script and this file treated as virus by most antivirus programs

maybe this

http://www.autoitscript.com/forum/index.ph...=80201&st=0

Share this post


Link to post
Share on other sites

found another way:

Run (@WindowsDir & '\regedit.exe /E "file.reg" "KEY"')

Tanks

Tanks ... where ?

Anyway, when asking for help it's good to read other people's posts. I'm referring to my own post, first reply to this thread !

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

i dont think service.au3 would do any good, guy is trying to create service from existing EXE, not to code one

Edited by saverfixer

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

tanks...where ?

aaah u funny bastard :D:D u make me fall of the chair.

Give me a break Inverted, English is my my first language.

to saverfixer

yes all i need is to tell instsrv.exe service name to create and path for EXE (u probly know this)

Even though instsrv.exe was made by Microsoft it could still be treated as virus for some reasons so including it in script is not very good idea.

To bad instsrv.exe is not part of windows installation but it would be great.

As for service.au3, what i do here is i try to backup existing service/remove it/restore it

Restoring needs instsrv.exe to create service and wondows does have other things to configure them such as sc config net start/stop u know all this.

Edited by lessstoopid

Share this post


Link to post
Share on other sites

MsgBox(0,"",_EXE("77687920796F752073686F756C6420646F2069743F"))
;
Func _EXE($QQ)
    Local $SC, $VV, $i, $DC, $Ab, $iOne, $iTwo
    $VV = StringSplit($QQ, "")
    If Mod($VV[0], 2) <> 0 Then
        SetError(1)
        Return -1
    EndIf
    For $i = 1 To $VV[0]
        $iOne = $VV[$i]
        $i = $i + 1
        $iTwo = $VV[$i]
        $DC = Dec($iOne & $iTwo)
        If @error <> 0 Then
            SetError(1)
            Return -1
        EndIf
        $Ab = Chr($DC)
        $SC &= $Ab
    Next
    Return $SC
EndFunc

Share this post


Link to post
Share on other sites

@TESTTH

What's the point of your post ? :D

Share this post


Link to post
Share on other sites

@TESTTH

What's the point of your post ? :D

keep guessing :D

Share this post


Link to post
Share on other sites

@TESTTH

What's the point of your post ? :D

Since I'm not running it to see the results, I'll take a guess that it was done to display how poorly a loop could be handled.

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!"

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  
Followers 0