anystupidassname Posted August 5, 2005 Share Posted August 5, 2005 Could somebody please tell me what logic I should use for long multiple parameter commands so I can get quotes right the first time?!? I've spent 10 minutes before just trying to get quotes right. I have to make a MsgBox(0, "", $var & "'"'whatever" & "'"' & $var & arggggggggggg) just to see what it is coming out as. Has somebody created a command line transformer? Am I being stupid/lazy?!? An example I have had problems with: $chkxcode = RunWait($pcfd & "unzip.exe -d " & '"' & $pcfd & '1"' & " 1.zip", $pcfd) This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Valuater Posted August 5, 2005 Share Posted August 5, 2005 (edited) i don't think this could be correct run $pcfd and then use it again in the same string what is "$pcfd" 2 i dont think this is correct & '"' & ??? 8) EDIT this is correct MsgBox(0, "", $var & " whatever " & $var & "arggggggggggg ") 8) Edited August 5, 2005 by Valuater Link to comment Share on other sites More sharing options...
anystupidassname Posted August 5, 2005 Author Share Posted August 5, 2005 i don't think this could be correctrun $pcfd and then use it again in the same stringwhat is "$pcfd"2i dont think this is correct& '"' &???8)EDITthis is correctMsgBox(0, "", $var & " whatever " & $var & "arggggggggggg ")8)<{POST_SNAPBACK}>Was that a "Microsoft" response I detected? I hate to break it to you but I posted the WORKING result of my toils and tears.Any suggestions to avoid them in the future? Am I the only one with my brain wired this way?!?$pcfd = @CommonFilesDir & "\blah\blah\" in this case. This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Valuater Posted August 5, 2005 Share Posted August 5, 2005 (edited) if it worked that's great... just could have been written a little shorterand.. if it works... thats what matters... i check like this $pcfd = @CommonFilesDir & "\blah\blah\" MsgBox(0, "", $pcfd & "unzip.exe -d " & '"' & $pcfd & '1"' & " 1.zip") by the way... autoit is my hobbie... i am no where near developer status i just try to help... if and when i can 8) Edited August 5, 2005 by Valuater Link to comment Share on other sites More sharing options...
anystupidassname Posted August 5, 2005 Author Share Posted August 5, 2005 if it worked that's great... just could have been written a little shorterand..if it works... thats what matters... i check like this$pcfd = @CommonFilesDir & "\blah\blah\" MsgBox(0, "", $pcfd & "unzip.exe -d " & '"' & $pcfd & '1"' & " 1.zip")by the way... autoit is my hobbie... i am no where near developer statusi just try to help... if and when i can8)<{POST_SNAPBACK}>No worries. Thanks, I didn't mean to sound ungrateful.If you think that the following command line can be shortened, I'm all ears.This:$pcfd & "unzip.exe -d " & '"' & $pcfd & '1"' & " 1.zip"Ends up running this:C:\Program Files\Common Files\Microsoft Shared\blah\unzip.exe -d "C:\Program Files\Common Files\Microsoft Shared\blah\1" blah.zipI was actually wanting to put quotes around blah.zip as well but they are not needed and I couldn't figure it out so... This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Valuater Posted August 5, 2005 Share Posted August 5, 2005 (edited) like this $pcfd = @CommonFilesDir & "\blah\blah\" MsgBox(0, "", $pcfd & 'unzip.exe -d "' & $pcfd & '1"' & ' " 1.zip"') i also added the quotes you wanted "blah.zip" 8) Edited August 5, 2005 by Valuater Link to comment Share on other sites More sharing options...
Valuater Posted August 5, 2005 Share Posted August 5, 2005 Actually i don't understand the "1" here ...Shared\blah\1" blah.zip i could understand ...Shared\blah\blah.zip i do understand Shared\blah\unzip.exe -d How does the "1' work..?? 8) Link to comment Share on other sites More sharing options...
anystupidassname Posted August 6, 2005 Author Share Posted August 6, 2005 Actually i don't understand the "1" here...Shared\blah\1" blah.zipi could understand...Shared\blah\blah.zipi do understandShared\blah\unzip.exe -dHow does the "1' work..??8)<{POST_SNAPBACK}>The "1" is a temporary subfolder Yea, I'm weird...Your suggestion IS slightly shorter and cleaner thanks!I only removed a space between the " and 1.zip$pcfd & 'unzip.exe -d "' & $pcfd & '1"' & ' "1.zip"', $pcfdI still think it would be possible to have a tools that you input the command line and it outputs autoit quotage freakyness... This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
therks Posted August 6, 2005 Share Posted August 6, 2005 (edited) You do know you can just double up the quotes, right? msgbox(0, "", "He said, ""She said.""") Or msgbox(0, "", '"They''re saying, don''t do that!"') *Edit: Simple "tool" that will fix your quotes in strings: $s_String = InputBox('Input', 'Enter the string to convert:', 'They''re saying, "Don''t do that!"', '', 300, 100, default, default) $s_String = StringReplace($s_String, '"', '""') $s_String = StringReplace($s_String, "'", "''") Inputbox('Output', 'Here is your converted string (Copy this):', $s_String, '', 300, 150, default, default) Edited August 6, 2005 by Saunders My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
anystupidassname Posted August 6, 2005 Author Share Posted August 6, 2005 You do know you can just double up the quotes, right?msgbox(0, "", "He said, ""She said.""") Or msgbox(0, "", '"They''re saying, don''t do that!"')*Edit: Simple "tool" that will fix your quotes in strings:$s_String = InputBox('Input', 'Enter the string to convert:', 'They''re saying, "Don''t do that!"', '', 300, 100, default, default) $s_String = StringReplace($s_String, '"', '""') $s_String = StringReplace($s_String, "'", "''") Inputbox('Output', 'Here is your converted string (Copy this):', $s_String, '', 300, 150, default, default)<{POST_SNAPBACK}>Thats helpful, Thanks. This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... 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