I am working on a simple application which should encrypt a string given by the command line and then write it to the registry. Unfortunately I am having trouble if the password contains special characters like " & < > |
.So for example:
Encrypt.exe /Password:Password /reg --> works fine
Encrypt.exe /Password:Password"&<>| /reg --> the password variable contains: Password&<>| /reg which is wrong
Encrypt.exe /Password:Password&<>| --> this outputs: "> was unexpected at this time." but no idea where this text is coming from
Encrypt.exe /Password:"Password&<>|" --> this works, but note that the password can't contains a " char and the encrypted/decrypted string will contain a " at the beginning and at the end
So my question is, how do I pass the string Password&<>|
correctly to my application?