Jump to content

"#" is being stripped


Recommended Posts

I am trying to run a program and pass a password directly into it. However my password ends with the "#" character and for some reason AutoIT is stripping it out so authentication fails.

$psswrd = ("passwordwitha#ontheend")

Can someone please tell me how to get around this?

Thanks in advance.

Link to comment
Share on other sites

@BigDaddyCool

It would seem your code is incorrect. I hope you don't have () around your variable assignments. The proper code should be...

$psswrd = "passwordwithapoundontheend#"

From here you would need to let us know what you're doing with that variable. We cannot help if we cannot duplicate the issue you're having, or see something in code, and seeing as you've only provided pseudo code we don't have the option of checking your code out either. If you can create a sample script that does the same thing as your actual script this would help immensely.

I hope this helps some,

Jarvis

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

$psswrd = "passwordwith#init"

; Run SSH2

Run("ssh2 username@domain.com")

WinWait("C:\Program Files\Attachmate\RSecure\ssh2.exe")

;Sleep(7500)

Send($psswrd)

Send("{ENTER}")

Pretty straight forward. I can get this to work as long as I do not have a # symbol anywhere in the password. I cannot find this as a requirement anywhere I look in the help file. I have 240+ servers worldwide that I will be using AUTOIT to connect to and they have # symbols in the passwords for the users. I can change this however it is not the easiest thing to accomplish.

Thanks

v/r

Link to comment
Share on other sites

I would recommend maybe trying ControlSend, ControlSetText just to see if there's a difference in their handling of the parameter. Have you tried putting your password directly in the Send function such as...

$psswrd = "passwordwith#init"
; Run SSH2
Run("ssh2 username@domain.com")
WinWait("C:\Program Files\Attachmate\RSecure\ssh2.exe")
;Sleep(7500)
;Send($psswrd)
Send("passwordwith#init")
Send("{ENTER}")oÝ÷ Ø l¢Úòjëh×6$psswrd = "passwordwith#init"
; Run SSH2
Run("ssh2 username@domain.com")
WinWait("C:\Program Files\Attachmate\RSecure\ssh2.exe")
;Sleep(7500)
Send($psswrd, 1)
Send("{ENTER}")

Thanks,

Jarvis

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Look at the send help file.

The # is getting changed to {windows key}. Change Send($psswrd) to Send($psswrd, 1).

Well done... I thought of that at the end of my post...

Jarvis

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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