Jump to content

Registry question


Recommended Posts

So I found that you can use the below command to extract registry keys. I'm curious, is there a command that will allow you to extract only 1 string value or is that possible?

runwait(@comspec & " /c " & 'REGEDIT /E ' & '"%userprofile%desktopnewoutlook profile.reg" "HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles"', "" ,@SW_HIDE)

Lets say the key is HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilestest

There is a string value inside of that called called happy

What would be the command to extract only that 1 string value to a reg file instead of all of test?

Also lets say I want to run the outlook profile.reg file that got created using auto it.

What command would I use to run it especially while using variables like %userprofile%?

Edited by noobieautolearn
Link to comment
Share on other sites

Have you looked at RegRead() yet in the help file?

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

Have you looked at RegRead() yet in the help file?

Ok, so I see how I could use regread and regwrite to do this, but this is more to help with creating new windows profiles where you have to reboot after the first stage and then run a second script which is why I want .reg files created with those values, I actually find it weird that there is no simple way to use a command to copy a single string value yet all it takes is simple text editiing in notepad to get the reg file down to one value and not a whole key.

I guess there is no way to do this easily?

Link to comment
Share on other sites

  • Moderators

I would tend to use regread and regwrite as Mechaflash suggested. If you absolutely must have a .reg file, just write it out:

$key = "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Test"
$val = "Happy"
$var = @DesktopDir & "\my.reg"

FileWriteLine($var, "Windows Registry Editor Version 5.00")
FileWriteLine($var, @CRLF)
FileWriteLine($var, "[" & $key & "]")
FileWriteLine($var, '"' & $val & '"="' & RegRead($key, $val) & '"')

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

RegRead() what you need, then use JLogan's example to write out the file. It seems the only way to do it the way you want to programmatically.

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

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