LAMSAG 0 Posted August 1, 2006 I am creating a shortcut to cmd.exe as follows: FileCreateShortcut(@SystemDir&"\cmd.exe", "My Link.lnk", $installDir, "/e:on /f:on /K "&$installDir&"\envVars.bat && cls", "Command Shell", $installDir&"\bin\myExe.exe") The problem is that the link is invalid, because in order to concatenate two commands when using the option /K in cmd .exe the string requires to be within " characters. How can I embed the " character within the string? Share this post Link to post Share on other sites
win2k 0 Posted August 1, 2006 (edited) Did you try sending the " as an ascii char ? like this $code=chr("148") msgbox(0,"",$code & "Hello" & $code ) Edited August 1, 2006 by win2k Share this post Link to post Share on other sites
LAMSAG 0 Posted August 1, 2006 Create a new variable: $cmdString = "/e:on /f:on /K "&Chr(34)&$installDir&"\envVars.bat && cls"&Chr(34) Then FileCreateShortcut(@SystemDir&"\cmd.exe", "My Link.lnk", $installDir, $cmdString, "Command Shell", $installDir&"\bin\myExe.exe") Share this post Link to post Share on other sites