Jump to content

Anyone knows environmental variable for this ?


Recommended Posts

yes, $sRet is the same as $var just with a different name - Authenticity is using good naming standards.

I would recommended using either Global or Local over Dim but that is minor point. While by default declaring vars is not required it is always recommend. I recommend enabling the MustDeclareVars option. The help file will help understand the rest ^_^

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Quick question:

Everything seems to be working OK as far as i can understand, but i cannot delete the key using regdelete and it returns 0 instead of -1 as for it worked.

Any idea what am doing wrong here ?

#Include <Security.au3>
$sAccount = @UserName
$SID = _Security__LookupAccountName($sAccount)
RegDelete ('HKU\' & $SID[0] & '\software\Autodesk', '')

You know its funny that help file says regdelete Success: Returns 1. But what i see is that -1 is the one actualy confirming that delete was success.

Link to comment
Share on other sites

I don't know much about the reg keys however I do know that the help file is 99.9% correct. (there are the odd errors).

"Returns 0 if the key/value does not exist." - I would ConsleWrite ('HKU\' & $SID[0] & '\software\Autodesk', '') and see if the key really does exist or run RegRead to see if it is there before trying to delete it.

Lastly there is no need to send '' for the value name, that is done by default.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Are you trying to delete the whole key or just the default value?

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

Link to comment
Share on other sites

Thanks for reply

i am trying to remove the key.

#Include <Security.au3>
$sAccount = @UserName
$SID = _Security__LookupAccountName($sAccount)
RegDelete ('HKU\' & $SID[0] & '\software\key', "")
if @error = -1 Then
MsgBox (0,"","Done")
ElseIf @error = 0 Then
    MsgBox (0,"","Cannot erase")
ElseIf @error = 2 Then
    MsgBox (0,"","Key not there")
EndIf
exit

using this code, with Test key created under S-1-5-21------------------\software, i get error Cannot erase.

Confused

Edited by lessstoopid
Link to comment
Share on other sites

$aRet[0] is not in the script, i get building error

It looks like regread understands this code

RegRead ('HKU\' & $SID[0] & '\software\Test', "")

Why RegDelete doesnt ?

Edited by lessstoopid
Link to comment
Share on other sites

  • Developers

Correct me if i am wrong. Everything that starts with $ is variable ? as it could be any word ?

If so, than $sRet same as $var ?

Does this post still rings a bell for you?

What about when you stop asking for examples and start looking at the helpfile and trying to sort out things yourself?

You cannot have been looking at it at all looking at the time between posts.

Jos

Your questions proves the fact that you don't take the time to figure things out for yourself and really do not bother to open the helpfile.

Just felt I needed to rub it in after the last comments you made towards me and didn't care to make any apologies.

Enjoy your stay in these forums.

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

$aRet[0] is not in the script, i get building error

It looks like regread understands this code

RegRead ('HKU\' & $SID[0] & '\software\Test', "")

Why RegDelete doesnt ?

Did you read Authenticitys post? To delete the default value the code you have is correct. To Delete the key remove the second parameter.

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

Link to comment
Share on other sites

It partially depends on your operating system but the registry key you're so desperate to read may well be the same as HKEY_CURRENT_USER. For example:

#Include <Security.au3>
$aAcct = _Security__LookupAccountName(@ComputerName & "\" & @UserName)
ConsoleWrite(RegRead("HKEY_USERS\" & $aAcct[0] & "\Software\AutoIt v3\AU3Info", "LastTab") & @CRLF)
ConsoleWrite(RegRead("HKEY_CURRENT_USER\Software\AutoIt v3\AU3Info", "LastTab") & @CRLF)

HKEY_CURRENT_USER is just an alias for HKEY_USERS\[Current User SID]

WBD

Link to comment
Share on other sites

dear JOS

PLEASE DONT BAN ME ^_^

I do look into help file allot and i try many times many different ways that i could think of before i post anything.

You need to get help with your "pushing me all the time" (power abuser)

Link to comment
Share on other sites

It partially depends on your operating system but the registry key you're so desperate to read may well be the same as HKEY_CURRENT_USER. For example:

#Include <Security.au3>
$aAcct = _Security__LookupAccountName(@ComputerName & "\" & @UserName)
ConsoleWrite(RegRead("HKEY_USERS\" & $aAcct[0] & "\Software\AutoIt v3\AU3Info", "LastTab") & @CRLF)
ConsoleWrite(RegRead("HKEY_CURRENT_USER\Software\AutoIt v3\AU3Info", "LastTab") & @CRLF)

HKEY_CURRENT_USER is just an alias for HKEY_USERS\[Current User SID]

WBD

Actualy its both here and there.

At this point i managed to read it and confirm it with @Error - 1

But i cannot delete it using same (blah blah) as i used to read it.

HAHA good example to wipe my autoit registry but i made cmd script to back up everything that autoit outputs into my computer so i can run another cmd script to restore it exactly where they were ^_^

Link to comment
Share on other sites

Insulting a dev/mod on any forum is not a good idea regardless of their attitude towards you that will get you banded quickly.

If AutoIt can see the key but cannot delete, it you need to find out why I suspect this has little to do with AutoIt, your system is preventing you from deleting the key. May be permissions, in use or some other constraint. Understand why your system is not allowing the function to execute. Always inspect the return and @error values.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

You might be right, but i dont have VISTA and have no problems erasing registry or anything else with simple CMD script.

As far as i understand, script was correct and if regread returns success then it works right.

Its weird why regdelete returns 0 ^_^

;;Always thought America was a freedom of speech country ? Guess it was just another lie like Pamela Anderon's boobz HEhehe

Edited by lessstoopid
Link to comment
Share on other sites

;;Always thought America was a freedom of speech country ? Guess it was just another lie like Pamela Anderon's boobz HEhehe

I'm not American so i'm not going to get into the speech thing and if I remember correctly, the forum creator is not American.

Just remember that the devs/mods created the program we freely use today so there should be a level of respect regardless if you agree with them or not.

Think of this is a shared house or a night club, may people visit but it still is private property. Do the wrong thing or piss off a bouncer, and there are going to be consequences. If you dont like a bouncer leave him alone its just playing smart.

You might want to google your issue or do an extensive search of the forum.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

  • Developers

You need to get help with your "pushing me all the time" (power abuser)

Talking about turning the world upside down.

Just look around and see what "types" I push, thus what catagory you are placed in until proven you have grown up.

;;Always thought America was a freedom of speech country ? Guess it was just another lie like Pamela Anderon's boobz HEhehe

You are lucky I am not exercising my freedom of speech toward you. ^_^

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

It's been stated many times but just for your benefit here it is again.

These forums ae not a Democracy. The only freedoms and rights you have are those allowed by Admin and Mods.

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

Link to comment
Share on other sites

  • Developers

It's been stated many times but just for your benefit here it is again.

These forums ae not a Democracy. The only freedoms and rights you have are those allowed by Admin and Mods.

Correct, the final say is with us on what goes in these forums.

Apart from that:The main thing I am trying to make clear is that "freedom of speech" doesn't not mean you can say anything you feel like and can attack people/groups in public and think to get away with it.

You need to understand that it comes with obligations and you can say anything but will be held accountable for what you are saying!

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

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