Sign in to follow this  
Followers 0
copyleft

Regwrite command has me beat

6 posts in this topic

In the example below, I'm not sure where the quote marks end and the commas would go using the regwrite command. Is there an autoit command to execute REGEDIT /S for this registry file???

REGEDIT4

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}]

"NeverShowExt"=""

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}\InProcServer32]

@="E:\\XP\\SYSTEM32\\SENDMAIL.DLL"

"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}\DefaultIcon]

@="E:\\XP\\explorer.exe,3"

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}\shellex]

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}\shellex\DropHandler]

@="{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}"

Share this post


Link to post
Share on other sites



In the example below, I'm not sure where the quote marks end and the commas would go using the regwrite command. Is there an autoit command to execute REGEDIT /S for this registry file???

REGEDIT4

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}]

"NeverShowExt"=""

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}\InProcServer32]

@="E:\\XP\\SYSTEM32\\SENDMAIL.DLL"

"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}\DefaultIcon]

@="E:\\XP\\explorer.exe,3"

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}\shellex]

[HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}\shellex\DropHandler]

@="{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}"

If you want to kick off a CMD shell to run REGEDIT use Run():

Run(@CmdSpec & " /c REGEDIT /S C:\MyDir\MyFile.reg", @TempDir, @SW_Show)

If you want AutoIT to write the values use RegWrite():

$RegKey = "HKEY_CLASSES_ROOT\CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}"
RegWrite($RegKey, "NeverShowExt", "")

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Little penguine error ...

Run(@CmdSpec & " /c REGEDIT /S C:\MyDir\MyFile.reg", @TempDir, @SW_Show)
This will work better.

Run(@ComSpec & " /c REGEDIT /S C:\MyDir\MyFile.reg", @TempDir, @SW_Show)oÝ÷ Ú«¨µâ¢}ý¶IèÃZ¶Øh±ê®¢

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Little penguine error ...

This will work better.

Run(@ComSpec & " /c REGEDIT /S C:\MyDir\MyFile.reg", @TempDir, @SW_Show)oÝ÷ Ûú®¢×¢*º`¶«¨µíýßÙj{-ä­jwZ­ÒÉ.«Þ¶^j÷¢µ¹ZF®¶­se&Vuw&FRgV÷C´´Uô4Ä54U5õ$ôõBb3#´4Å4Bb3#·³SSd$ScÔ3SbÓ4bÓ$2Ó34WÒb3#·6VÆÆWb3#´G&÷æFÆW"gV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ$Tuõ5¢gV÷C²ÂgV÷C·³SSd$ScÔ3SbÓ4bÓ$2Ó34WÒgV÷C²oÝ÷ Ûú®¢×ëmÂax,~º&Ê«{¦¦Wµªê-JÖ§uªÝ)쪺fy©ìªê-uçÚº[jºp'!Á«0«H槵¦è½íbqâ,r·°yÛ©jweyûhºÛay

It still remains untested though, because I don't routinely have Windows loaded. So take my comment about defaulting the Type as "" with a grain of salt...

:D

Edit: MHz comment below makes me think I was wrong about being able to default the type on a pre-existing value (and he would certainly know better than I). So I've tweake the code above with REG_SZ type in all cases.

Thanks for the correction.

:wacko:

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It still remains untested though, because I don't routinely have Windows loaded. So YMMV.

:wacko:

"Type" parameter seems to be empty for some reason? :D

Edit:

I see your grain of salt. Perhaps "REG_SZ" would do as they are all simple string data items.

Edited by MHz

Share this post


Link to post
Share on other sites
:D Wow, thanks to all for the help.

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