Jump to content

[Resolved] Regwrite doesn't affect registry. What's wrong?


Diana (Cda)
 Share

Recommended Posts

This doesn't affect the registry:

RegWrite('"HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\PowerDesk\Command\L:\WEReplacements\WERepl- PowerDesk Pro 6\APP- PowerDesk Pro 6\pdexplo.exe" "%1"')
It's just a simple key change and the REG file works but not this AI one. I'd prefer to have AI do it because hopefully can script it so that I don't have to press the OKAY buttons that come up with a registry merge file.

What is wrong with this syntax? I've played around with it and tried over a dozen things but nothing works. I got the syntax from the help file and studied many of the forum's message re regwrite but it's just so frustrating that this doesn't work. I'll be really interested to know what I'm doing wrong.

Thanks so much. Thank goodness this forum is here. AI is the only app I have that gives my ego such a trouncing, but thankfully you guys are here! <lol>

Edited by Diana (Cda)
Link to comment
Share on other sites

$ret = RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\PowerDesk\", "Command", "REG_SZ", _
'"L:\WEReplacements\WERepl- PowerDesk Pro 6\APP- PowerDesk Pro 6\pdexplo.exe" "%1"')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ret = ' & $ret & @crlf & '>Error code: ' & @error & @crlf)
; returns 1 if reg write successful

different syntax for regwrite from commandline (Run, ShellExecute)

need to separate into key to write, section, key type and value, just as it says in the help file

Thanks so much. Thank goodness this forum is here. AI is the only app I have that gives my ego such a trouncing, but thankfully you guys are here! <lol>

everyones ego gets a trouncing sooner or later, for some people in this world hopefully sooner...

we're all baby seals waiting to be clubbed by life in the greater scheme of things...

programming is not unlike everything else, 'One thing leads to another".

a bit like that scene in the film Poltergeist where the mother runs down the hallway to the kids room

and the corridor telescopes out in length in front of her, the faster you run, the further away you are from your goal...

Edited by rover

I see fascists...

Link to comment
Share on other sites

$ret = RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\PowerDesk\", "Command", "REG_SZ", _
'"L:\WEReplacements\WERepl- PowerDesk Pro 6\APP- PowerDesk Pro 6\pdexplo.exe" "%1"')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ret = ' & $ret & @crlf & '>Error code: ' & @error & @crlf)
; returns 1 if reg write successful

different syntax for regwrite from commandline (Run, ShellExecute)

need to separate into key to write, section, key type and value, just as it says in the help file

Yes <g>. It's just that the help file is chinese to me half the time <g>.

I'll try this at home.

I'm having quite a few difficulties with XP and this workaround will be of enormous help. Even expert help from XP ngs hasn't gotten around some XP deficiencies that I feel I can't live with and files like this help. Thanks.

As an aside, what I'm very happy about is that I'll be moving over to a Linux system very soon, I believe. I finally met and spoke with a couple of people here at work that have extensive Linux experience and learned about WINe. The only thing holding me back all these years from using anything other than Windows was the fact that I have too much work, programs and research that require Windows (programs are quite obscure and very difficult to find), so it's doubtful I'd ever find a Linux equivalent anytime soon. But by using WINe for those, I know that I'll adapt to new OS very, every easily for absolutely everything else! Everything I've seen so even if it was only Knoppix and I have yet to try others, makes me feel extremely hopeful for the first time in a long time. Windows has gone down the tubes slowly after Win98SE, with XP being garbage for me (I'm not talking technology. No doubt that it's technologically much more advanced). For me, if a Volkswagen does the job efficiently, quickly and with no errors, I don't care if the faulty Ferarri is a better machine if the end result is reached with much frustration and ultimately takes longer, etc.! I'll take the Volkswagen over it any day! And that's the case with the way Windows has gone. I shudder to think what Vista is like!!! At any rate, no longer an issue for me!!! Everything I've seen in Linux so far makes me feel it'll be ideal for me. Unlike in the beginning, Linux seems to have come so far that even those of us who have been using Windows for years can make the change very easily.

But a lot of my AI scripts I'll still need including this one. And, of course, 99% of my scripts I need for work and I still have 20+ years to go in the workforce ... <g>

Thanks much! :)

Edited by Diana (Cda)
Link to comment
Share on other sites

$ret = RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\PowerDesk\", "Command", "REG_SZ", _
'"L:\WEReplacements\WERepl- PowerDesk Pro 6\APP- PowerDesk Pro 6\pdexplo.exe" "%1"')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ret = ' & $ret & @crlf & '>Error code: ' & @error & @crlf)
; returns 1 if reg write successful
Hi, hate to say it but I get the usual, "nothing happens". And I mean that literally. I can't understand all the code above here yet but I'm guessing that something might be "returned" meaning some sort of message box, perhaps? No Windows error box comes up and AI doesn't return any error message yet unlike when I use a similar reg file, when I open a folder, PowerDesk Pro isn't invoked and folder doesn't open.

What could be wrong here, anyone know?

Link to comment
Share on other sites

  • Developers

When you run the above code in SciTE it should display a debugline with information about the success of the regwrite() func in the OutputPane.

Are you sure you need the last backslash on the first parameter ?

EDIT: Also expect the regwrite should be:

$ret = RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\PowerDesk\Command","", "REG_SZ", _
        '"L:\WEReplacements\WERepl- PowerDesk Pro 6\APP- PowerDesk Pro 6\pdexplo.exe" "%1"')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ret = ' & $ret & @CRLF & '>Error code: ' & @error & @CRLF)
Edited by Jos

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

When you run the above code in SciTE it should display a debugline with information about the success of the regwrite() func in the OutputPane.

Are you sure you need the last backslash on the first parameter ?

EDIT: Also expect the regwrite should be:

$ret = RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\PowerDesk\Command","", "REG_SZ", _
        '"L:\WEReplacements\WERepl- PowerDesk Pro 6\APP- PowerDesk Pro 6\pdexplo.exe" "%1"')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ret = ' & $ret & @CRLF & '>Error code: ' & @error & @CRLF)
Wow, I didn't know about this feature. Wow. I had to look through all the commands to find this but it seems that my guess of TOOLS > GO did the trick.

I got this at the bottom of the SciTE screen but haven't a clue (other than the missing AU3 exe file error) on what it means:

>"L:\AutoIt\TOOLS\Editor- SciTE\SciTE v1.74\APP- SciTE v1.74\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\Administrator\Desktop\reg.au3" /autoit3dir "L:\AutoIt\TOOLS\Editor- SciTE\SciTE v1.74\APP- SciTE v1.74\.." /UserParams   
+>10:24:52 Starting AutoIt3Wrapper v.1.9.2
! *** AU3CHECK Error: *** Skipping AU3Check: \au3check.exe Not Found !

>Running:(0.0.0.0):\autoit3.exe "C:\Documents and Settings\Administrator\Desktop\reg.au3"   
+>10:24:52 AutoIT3.exe ended.rc:0
+>10:24:53 AutoIt3Wrapper Finished
>Exit code: 0   Time: 1.194
It doesn't seem to say anything re whether or not it was successful, only that that file was missing.

I use my AI as a standalone, so would be good idea to fix path to AU3Check.exe. I'll search forum for that part since without SciTE knowing where it is, that this debug won't give me back a proper answer ... (though I could be wrong ... ??)

Link to comment
Share on other sites

  • Developers

Wow, I didn't know about this feature. Wow. I had to look through all the commands to find this but it seems that my guess of TOOLS > GO did the trick.

I got this at the bottom of the SciTE screen but haven't a clue (other than the missing AU3 exe file error) on what it means:

>"L:\AutoIt\TOOLS\Editor- SciTE\SciTE v1.74\APP- SciTE v1.74\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\Administrator\Desktop\reg.au3" /autoit3dir "L:\AutoIt\TOOLS\Editor- SciTE\SciTE v1.74\APP- SciTE v1.74\.." /UserParams   
+>10:24:52 Starting AutoIt3Wrapper v.1.9.2
! *** AU3CHECK Error: *** Skipping AU3Check: \au3check.exe Not Found !

>Running:(0.0.0.0):\autoit3.exe "C:\Documents and Settings\Administrator\Desktop\reg.au3"   
+>10:24:52 AutoIT3.exe ended.rc:0
+>10:24:53 AutoIt3Wrapper Finished
>Exit code: 0   Time: 1.194
It doesn't seem to say anything re whether or not it was successful, only that that file was missing.

I use my AI as a standalone, so would be good idea to fix path to AU3Check.exe. I'll search forum for that part since without SciTE knowing where it is, that this debug won't give me back a proper answer ... (though I could be wrong ... ??)

Looks like you are also running a pretty old version of scite4autoit3... maybe upgrade that first since that should be able to find au3check in the autoit3 program directory and make sure its stored in a subdirectory named SciTE of your AI directory.

Did you try the changed version of the regwrite statement i posted ?

Jos

Edited by Jos

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

Jos is right, apologies Diana

works with or without the "\" at the end

totally missed the format of that key (Default)

even though it's right there in the registry.

see the second half of my post :)

retreating back to dealing with my headcold...

I see fascists...

Link to comment
Share on other sites

  • 3 weeks later...

$ret = RegWrite("HKEY_CLASSES_ROOT\Folder\shell\PowerDesk\Command","", "REG_SZ", _
        '"K:\WEReplacements\WERepl- PowerDesk Pro 6\APP- PowerDesk Pro 6\PDExplo.exe" "%1"')
Don't know the why's of it, but this now works. The change in path wasn't what affected it, that happened because of an OS reinstall last weekend and XP assigning different drive letter. But, it's now working. Suspect it's the more complete code including the "command" part right into the path rather than being separate, that that's why it's now working. But who knows. Was getting tired of the .bat file because the DOS window would keep popping up. AI is always better as it's so behind-the-scenes. Don't know where to change the path command in the app itself, probably behind-the-scenes, too. But this works around that and that's all that matters.

Thanks. :)

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