LAMSAG Posted August 1, 2006 Share 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? Link to comment Share on other sites More sharing options...
win2k Posted August 1, 2006 Share 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 Link to comment Share on other sites More sharing options...
LAMSAG Posted August 1, 2006 Author Share 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") Link to comment Share on other sites More sharing options...
Helge Posted August 1, 2006 Share Posted August 1, 2006 FAQ #7 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now