This works fine on my machine.
Are you using any special characters in you password?
Try using quotation marks at your password in the script.
start /D "C:\Program Files\PuTTY\" putty.exe -ssh 192.168.1.104 -l pi
-pw "mypassword"
Some characters in Windows command line have specific meaning i.e. @
, $
, !
, %
, =
, \
, so you could easily output another string as password argument, or form an escape sequence.
For example, %0
-%9
would output arguments no. 0 - no. 9 passed to the batch script file, %cd%
would print current path.
Here is a table of escape sequences used in Windows batch script files.
+-------------------------+-----------------+
| Character to be escaped | Escape Sequence |
+-------------------------+-----------------+
| % | %% |
| ^ | ^^ |
| & | ^& |
| < | ^< |
| > | ^> |
| | | ^| |
| ' | ^' |
| ` | ^` |
| , | ^, |
| ; | ^; |
| = | ^= |
| ( | ^( |
| ) | ^) |
| ! | ^^! |
| " | "" |
| \ | \\ |
| [ | \[ |
| ] | \] |
| " | \" |
| . | \. |
| * | \* |
| ? | \? |
+-------------------------+-----------------+
Hope this helps.