CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jun 2005
    Posts
    44

    How to create a Registry Script ?

    Hi All,

    I found a file named "abc.reg". on executing it an entry is made into the registry.

    i tried creating one by editing a file in notepad and naming it as "xyz.reg" but on execution it said "The specified file is not a registry Script".

    Now how do i create a registry Script ?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    2,042

    Re: How to create a Registry Script ?

    There are several versions. I think version 4 is compatible with most windows versions in use today. The content is like this:
    Code:
    REGEDIT4
    
    [<dir1>]
    "<integer key name>"=dword:12345678
    "<string key name>"="Something"
    
    [<dir2>]
    etc.
    The value of a dword should be expressed by 8 hexadecimal numbers. A string value should always be put between double quotes. Note that the name of a key is also placed between double quotes.
    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

  3. #3
    Join Date
    Jun 2005
    Posts
    60

    Question Re: How to create a Registry Script ?

    i know how to make a .reg file to add or modify a entry in the registry

    how to make one for removing a entry ?

  4. #4
    Join Date
    Apr 1999
    Posts
    3,585

    Re: How to create a Registry Script ?

    Take a look at this article on Regedit4.
    Gort...Klaatu, Barada Nikto!

  5. #5
    Join Date
    Jun 2005
    Posts
    44

    Re: How to create a Registry Script ?

    Hi,

    I tried writing a script....

    The OS is Win2K
    File name is Putta.reg

    Contents of the file...

    REGEDIT4

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
    "PF_AccessoriesName"="Something"

    On Double click it says "The specified file is not a registry script.you can import only registry files".

    what wrong ?

  6. #6
    Join Date
    Apr 1999
    Posts
    3,585

    Re: How to create a Registry Script ?

    Did you check out that article? You must have missed this...

    Under Windows 2K and XP the first line is:
    Windows Registry Editor Version 5.00
    Gort...Klaatu, Barada Nikto!

  7. #7
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    2,042

    Re: How to create a Registry Script ?

    Quote Originally Posted by Mike Harnad
    Did you check out that article? You must have missed this...
    It's backwards compatible. At least for version 4. As far as I know, version 4 can be used in Windows 9x and NT based, whereas version 5 is not supported by the former.
    Last edited by D_Drmmr; August 3rd, 2005 at 03:40 PM.
    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

  8. #8
    Join Date
    Jun 2005
    Posts
    44

    Re: How to create a Registry Script ?

    Hi,

    i did go through the article and used it as specified but still it does not work.

  9. #9
    Join Date
    Nov 2007
    Posts
    1

    Re: How to create a Registry Script ?

    Hi, you're true.

    the tip is to use notepad and to save the reg file as "ANSI" and not "unicode" in the "save as" window.

    regards.

  10. #10
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How to create a Registry Script ?

    Quote Originally Posted by Kris_V
    REGEDIT4

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
    "PF_AccessoriesName"="Something"

    On Double click it says "The specified file is not a registry script.you can import only registry files".

    what wrong ?
    I've created the file, and it has been ingested with no problem (see screenshot). Win2003 Server is my platform.
    Attached Images Attached Images  
    Best regards,
    Igor

  11. #11
    Join Date
    Nov 2007
    Posts
    613

    Re: How to create a Registry Script ?

    Here's the simplest way to create a registry script. Supposing the settings are already in your registry, from regedit right click the key you need and select the Export option. It will create the script file automatically. That's all.

  12. #12
    Join Date
    Mar 2009
    Posts
    1

    Re: How to create a Registry Script ?

    I have tried many times to edit a .reg file that was created using Export... in regedit. I always ended up with a file that wouldn't import.
    Here's the weird trick: when you export a file from regedit, it generates a Unicode file.
    But when you edit that file, you have to save it as ASCII in order for it to import properly when you double-click it.
    I have no idea why this is, but using this simple trick just enabled me to successfully edit and re-import a .reg file for the first time.
    Good luck,
    -Roy

  13. #13
    Join Date
    Feb 2014
    Posts
    2

    Re: How to create a Registry Script ?

    Hello,

    Could someone please tell me the errors in these scripts and possibly a reference link for writing the proper script syntax for both of these registry tools?

    Code:
    Windows Registry Editor version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
    "IMJPMIG8.1"=-
    
    and...
    
    REGEDIT 4
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
    "IMJPMIG8.1"=-
    Thank you,
    - Dean -

  14. #14
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: How to create a Registry Script ?

    Open the register editor (regedit), and export the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run key.
    So you will see the proper format...


    BTW, what are you trying to achieve?
    Victor Nijegorodov

  15. #15
    Join Date
    Feb 2014
    Posts
    2

    Re: How to create a Registry Script ?

    Hi Victor,

    Thanx for the quick reply. Actually, I'm not as concerned about finding the errors in these as I am locating a site that would show me the proper syntax for editing registry entries with the registry tools listed. I'm in the process of training to be a malware technician for an online site and this was one of the questions that came up. The registry keys are rhetorical, of course. Just an example I need to research. I'm finding lots of references to this, but can't seem to find the errors.

    For now, the registry is still like deciphering hieroglyphics to me. So finding info in an easy to understand format would be helpful. So if you have any references I can check, that would be wonderful. Not looking to be given the answers here, as that would teach me nothing. Just hoping to find some references I can research myself.

    Thanx for all the help.
    - Dean -

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured