batch file - How to run a remote task using user name and password when password contains a '€' character? -


i'm trying run task on remote server using jenkins. i'm using command line:

schtasks /run /s <remote server> /u <user> /p <password> /tn <task name> 

this worked fine new customer has '€' character inside password , can't figure out how pass cmd line correctly. it's being replaced '?' because standard cmd font doesn't support th € sign. inside cmd console can solve problem changing dafault font "lucida console" can't in jenkins or make batch-script use font.

most services/server require authentication user name , password not allow characters code value greater decimal 127 because results in problems one.

the euro sign has code value 20ac (hexadecimal, 8364 decimal) in unicode table.

but in code page windows-1252 western european , north american countries euro sign has code value 80 (hexadecimal, 128 decimal). in code page windows-1251 cyrillic text euro sign has code value 88 (hexadecimal, 136 decimal).

so must found out service expects password:

  1. a unicode string or "ansi" string?
    (the windows code pages defined microsoft not ansi standard.)
  2. which code page respectively code value use in case of "ansi" string.

the active code page on executing batch file can found out running in command prompt window command chcp can used switch code page. see short output entering chcp /?

the code page 850 example set default on german windows console.

now let assume user has entered euro sign in gui window used windows-1252 , password string encoded not in unicode resulting in having stored euro sign decimal value 128. in case necessary transmit byte value 128 in password string within batch file service/server. looking on character table code page 850 can found out character Ç has code value 128 in code page. try in batch file c-cedilla letter.

but best solution user changes password , avoids time using special character code value greater decimal 127.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -