Sign in to follow this  
Followers 0
chiners_68

Error can somone help...

11 posts in this topic

im getting the following message for this line of code.

"Variable used without being declaring"

$sEncrypted = _StringEncrypt(0, "B2AC46E2A1E2803CECA17DCDAAE3CA24558D417F4876F9E4998A224F2E70D7E5FCEF3C4272B4141E8E917443EFECE6436119F6AD16EC7B37779BCC9A41C8DF5FC4EC10313257970EE632950837FE5C98", $s_TESTING123, $i_3)

Share this post


Link to post
Share on other sites



im getting the following message for this line of code.

"Variable used without being declaring"

$sEncrypted = _StringEncrypt(0, "B2AC46E2A1E2803CECA17DCDAAE3CA24558D417F4876F9E4998A224F2E70D7E5FCEF3C4272B4141E8E917443EFECE6436119F6AD16EC7B37779BCC9A41C8DF5FC4EC10313257970EE632950837FE5C98", $s_TESTING123, $i_3)
Well.... What are the values of $s_TESTING123 and $i_3 before you run that?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Im using "EndFunc's" encrption GUI to create my Encrypted key

TESTING123=password for the encryption

3=Encryption level

this was what I was told to do with the key password etc.

#include <string.au3>

$sEncrypted = _StringEncrypt(0, "YourEncryptedString", $s_EncryptPassword, $i_EncryptLevel)

;Replace your password or whatever string with $sEncrypted variable and it will decrypt it.

does this help..?

Edited by chiners_68

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Im using "EndFunc's" encrption GUI to create my Encrypted key

TESTING123=password for the encryption

3=Encryption level

this was what I was told to do with the key password etc.

does this help..?

LOL... well, you gave us a snippet of nothing. If we run it, we are going to get an error "Undeclared Variable" on the 2 variables I asked you about.

Just post exactly what your code is. Or if you do Ctrl+F5 and look in the SciTe output pane at the bottom of SciTe, it may even point to the actual variable(s) that isn't/aren't being declared.

Edit:

P.S. - I know how to read the help file, but thanks for the snippet.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

this is all my code.

Passwords & encrpted password are only testing ones so not worried they are posted.

#include <string.au3>

$sEncrypted = _StringEncrypt(0, "B2AC46E2A1E2803CECA17DCDAAE3CA24558D417F4876F9E4998A224F2E70D7E5FCEF3C4272B4141E8E917443EFECE64

36119F6AD16EC7B37779BCC9A41C8DF5FC4EC10313257970EE632950837FE5C98", $s_AZXTRSDAK1, $i_3)

;*******************************************************************************

;Local Admin password Set

;*******************************************************************************

RunWait('net user Administrator $sEncrypted', '', @SW_HIDE)

;*******************************************************************************

;Add Test_Users to local Administrator group

;*******************************************************************************

RunWait('net localgroup ' & 'Administrators ' & '/add "Domain\Test_Users"', '', @SW_HIDE)

Edited by chiners_68

Share this post


Link to post
Share on other sites

Ok, and you don't see your error? $s_AZXTRSDAK1 and $i_3 are not defined before you run _StringEncrypt().

#include <string.au3>
Dim $s_AZXTRSDAK1 = 'Put something here';Giving $s_AZXTRSDAK1 a value, which is the password you used to encrypt it
Dim $i_3 = 'Put something here';Giving $i_3 a value, which is the level of encryption you used to encrypt it
$sEncrypted = _StringEncrypt(0, "B2AC46E2A1E2803CECA17DCDAAE3CA24558D417F4876F9E4998A224F2E70D7E5FCEF3C4272B4141E8E917443EFECE64
36119F6AD16EC7B37779BCC9A41C8DF5FC4EC10313257970EE632950837FE5C98", $s_AZXTRSDAK1, $i_3)

;*******************************************************************************
;Local Admin password Set
;*******************************************************************************

RunWait('net user Administrator $sEncrypted', '', @SW_HIDE)

;*******************************************************************************
;Add PC Administrators to local Administrator group
;*******************************************************************************

RunWait('net localgroup ' & 'Administrators ' & '/add "Domain\Test_Users"', '', @SW_HIDE)

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I get you. its stearing me in the face..

I need to put

$s_EncryptPassword=AZXTRSDAK1

$i_EncryptLevel=3

$sEncrypted = _StringEncrypt(0, "B2AC46E2A1E2803CECA17DCDAAE3CA24558D417F4876F9E4998A224F2E70D7E5FCEF3C4272B4141E8E917443EFECE64

36119F6AD16EC7B37779BCC9A41C8DF5FC4EC10313257970EE632950837FE5C98", $s_EncryptPassword, $i_EncryptLevel)

correct?

Edited by chiners_68

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I get you. its stearing me in the face..

I need to put

correct?

That would work as well, but if those are your password and encryption level, you could have just done:
#include <string.au3>
$sEncrypted = _StringEncrypt(0, "B2AC46E2A1E2803CECA17DCDAAE3CA24558D417F4876F9E4998A224F2E70D7E5FCEF3C4272B4141E8E917443EFECE6436119F6AD16EC7B37779BCC9A41C8DF5FC4EC10313257970EE632950837FE5C98", 'AZXTRSDAK1', 3)

;*******************************************************************************
;Local Admin password Set
;*******************************************************************************

RunWait('net user Administrator $sEncrypted', '', @SW_HIDE)

;*******************************************************************************
;Add PC Administrators to local Administrator group
;*******************************************************************************

RunWait('net localgroup ' & 'Administrators ' & '/add "Domain\Test_Users"', '', @SW_HIDE)
Removing the variables completely from the picture.

Edit:

There were spaces in the encrypted string for some reason, and I removed the original vars.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Smoke N,

its working a treat with your last post way.

only problem ive got is the encoded string is not going in as my local admin password the variable is my pasword. ie $sEncrypted lol.

how do i get round this one.

Share this post


Link to post
Share on other sites

Smoke N,

its working a treat with your last post way.

only problem ive got is the encoded string is not going in as my local admin password the variable is my pasword. ie $sEncrypted lol.

how do i get round this one.

Well, I would imagine if you are "sending" something that is stored in a variable, that you would actually have to send that variable within the function itself... wouldn't you?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

sorry for my ignorance but how would i do that..?

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