jezzzzy Posted October 19, 2005 Share Posted October 19, 2005 Anyone have any idea why the following produces a file name surrounded by single quotes in my dos window? ControlSend(@systemDir & '\cmd.exe','','','put "' & $fileToPlot & '"' & '{ENTER}') Screenshot of cmd window attached. Link to comment Share on other sites More sharing options...
markusss Posted October 19, 2005 Share Posted October 19, 2005 Anyone have any idea why the following produces a file name surrounded by single quotes in my dos window?ControlSend(@systemDir & '\cmd.exe','','','put "' & $fileToPlot & '"' & '{ENTER}')Screenshot of cmd window attached.Dows this work?:ControlSend(@systemDir & '\cmd.exe','','','put ' & $fileToPlot & '' & '{ENTER}')HFFelix N. (tdlrali) Link to comment Share on other sites More sharing options...
jezzzzy Posted October 19, 2005 Author Share Posted October 19, 2005 Dows this work?:ControlSend(@systemDir & '\cmd.exe','','','put ' & $fileToPlot & '' & '{ENTER}')HFFelix N. (tdlrali)Not exactly. It works as long at the filename does not contain spaces. My problem is I need to surround the filename in double quotes. My ControlSend() is producing single quotes for some reason. I need double quotes -- singles don't work in a dos/ftp put command. Link to comment Share on other sites More sharing options...
Endgame Posted October 19, 2005 Share Posted October 19, 2005 Not exactly. It works as long at the filename does not contain spaces. My problem is I need to surround the filename in double quotes. My ControlSend() is producing single quotes for some reason. I need double quotes -- singles don't work in a dos/ftp put command.Give this a try:ControlSend(@systemDir & "\cmd.exe","","","put """ & $fileToPlot & """{ENTER}")Endgame EndgameMy UDFsFile Size ConvertMacros in INI UDF Link to comment Share on other sites More sharing options...
Rick Posted October 19, 2005 Share Posted October 19, 2005 what is the line you actually want to see on the command line? Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
jezzzzy Posted October 19, 2005 Author Share Posted October 19, 2005 what is the line you actually want to see on the command line?The line highlighted in the attached image should read:put "1 ,2.plt"notput '1 ,2.plt' Link to comment Share on other sites More sharing options...
jezzzzy Posted October 19, 2005 Author Share Posted October 19, 2005 Give this a try:ControlSend(@systemDir & "\cmd.exe","","","put """ & $fileToPlot & """{ENTER}")EndgameThanks. Tried the double - double quote method also. Result is attached. No dice. Still give me single quotes. Link to comment Share on other sites More sharing options...
Endgame Posted October 19, 2005 Share Posted October 19, 2005 ControlSend(@systemDir & "\cmd.exe","","","put """ & $fileToPlot & """{ENTER}") The above code should work. Endgame EndgameMy UDFsFile Size ConvertMacros in INI UDF Link to comment Share on other sites More sharing options...
Rick Posted October 19, 2005 Share Posted October 19, 2005 (edited) how about ControlSend(@systemDir & "\cmd.exe" & " put " & """" & $fileToPlot & """" & {ENTER}) Edited October 19, 2005 by Rick Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
Endgame Posted October 19, 2005 Share Posted October 19, 2005 how aboutControlSend(@systemDir & "\cmd.exe" & " put " & """" & $fileToPlot & """" & {ENTER})I think the {ENTER} needs to be in quotes. EndgameMy UDFsFile Size ConvertMacros in INI UDF Link to comment Share on other sites More sharing options...
Rick Posted October 19, 2005 Share Posted October 19, 2005 I think the {ENTER} needs to be in quotes. ok, i was close lol Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
/dev/null Posted October 19, 2005 Share Posted October 19, 2005 (edited) Anyone have any idea why the following produces a file name surrounded by single quotes in my dos window?No idea, but this one works (tested). Important: WinActivate is necessary, otherwise the double quotes are not send! Reason: I don't know ....$fileToPlot = "hello world.txt" $doublequote = chr(132) WinActivate(@systemDir & '\cmd.exe') ControlSend(@systemDir & '\cmd.exe','','',"put {" & $doublequote & "}" & $fileToPlot & "{" & $doublequote & "}{ENTER}")CheersKurt Edited October 19, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
jezzzzy Posted October 19, 2005 Author Share Posted October 19, 2005 No idea, but this one works (tested). Important: WinActivate is necessary, otherwise the double quotes are not send! Reason: I don't know ....$fileToPlot = "hello world.txt" $doublequote = chr(132) WinActivate(@systemDir & '\cmd.exe') ControlSend(@systemDir & '\cmd.exe','','',"put {" & $doublequote & "}" & $fileToPlot & "{" & $doublequote & "}{ENTER}")CheersKurtI'll try this - but isn't a double quote chr(34)? Link to comment Share on other sites More sharing options...
/dev/null Posted October 19, 2005 Share Posted October 19, 2005 I'll try this - but isn't a double quote chr(34)?Yes, it should be, but for some reason using chr(34) in ControlSend() results in put 2hello world.txt2. I still don't know why....CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
jezzzzy Posted October 19, 2005 Author Share Posted October 19, 2005 Yes, it should be, but for some reason using chr(34) in ControlSend() results in put 2hello world.txt2. I still don't know why....CheersKurtChr(132) gives me commas.put ,hello world.txt, Link to comment Share on other sites More sharing options...
/dev/null Posted October 19, 2005 Share Posted October 19, 2005 (edited) Yes, it should be, but for some reason using chr(34) in ControlSend() results in put 2hello world.txt2. I still don't know why....CheersKurtit's not AutoITs fault. The command windows interprets the sent characters in a different way than other controls.This works with notepad as expected.$fileToPlot = "hello world.txt" $doublequote = Chr(34) WinActivate('Untitled - Notepad') ControlSend('Untitled - Notepad', '', 'Edit1', "put {" & $doublequote & "}" & $fileToPlot & "{" & $doublequote & "}{ENTER}")CheersKurt Edited October 19, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
/dev/null Posted October 19, 2005 Share Posted October 19, 2005 Chr(132) gives me commas.put ,hello world.txt,??? What's your system? I tested on Win2k and it works as described....BTW: You should consider using the FTP UDFs made by w0uter: http://www.autoitscript.com/forum/index.php?showtopic=12473.That's much better then using ControlSend().CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
herewasplato Posted October 19, 2005 Share Posted October 19, 2005 ControlSend("cmd", "", "", Chr(34)) gives me a single quote on XPPlay with this code:AutoItSetOption("WinTitleMatchMode", 2) Run("cmd") WinWaitActive("cmd") For $i = 30 To 132 WinActivate("cmd") WinWaitActive("cmd") Send("{BS 40}") Send("Chr " & $i & "...Send...>" & Chr($i)) ControlSend("cmd", "", "", Chr($i)) Send("<...ControlSend") MsgBox(0, "Chr(" & $i & ")", Chr($i), 2) Next [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jezzzzy Posted October 20, 2005 Author Share Posted October 20, 2005 ControlSend("cmd", "", "", Chr(34)) gives me a single quote on XPPlay with this code:AutoItSetOption("WinTitleMatchMode", 2) Run("cmd") WinWaitActive("cmd") For $i = 30 To 132 WinActivate("cmd") WinWaitActive("cmd") Send("{BS 40}") Send("Chr " & $i & "...Send...>" & Chr($i)) ControlSend("cmd", "", "", Chr($i)) Send("<...ControlSend") MsgBox(0, "Chr(" & $i & ")", Chr($i), 2) NextMe also. Which is why it doesn't work. I need to find the Chr() that corresponds to a double quote in a ControlSend(). How do I find it? Link to comment Share on other sites More sharing options...
jezzzzy Posted October 20, 2005 Author Share Posted October 20, 2005 ??? What's your system? I tested on Win2k and it works as described....BTW: You should consider using the FTP UDFs made by w0uter: http://www.autoitscript.com/forum/index.php?showtopic=12473.That's much better then using ControlSend().CheersKurtUsing W2k. Not sure why it's not working the way you have tested. Maybe it has to do with the send to the DOS window. I'll look into the FTP UDF now. I'll keep you posted. 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