1.

Solve : a batch with blank spaces in between?

Answer» <html><body><p>how to <a href="https://interviewquestions.tuteehub.com/tag/create-427332" style="font-weight:bold;" target="_blank" title="Click to know more about CREATE">CREATE</a> a batch with copy as header and end with lpt1?<br/>copy space space lpt1<br/>so when i click on it, it will run, but not stop/end, then i can enter my file name in between the space space, then it run only when i hit enter key..<br/>Im afraid I cannot even guess what you want!<br/><br/>Are you trying to get user input ? if so, use Set /Pwhen i click the .bat file, it will call the cmd.exe then at the cmd, it auto insert "copy   lpt1" but the line will not run, until i type my file name in between, like "copy 1.txt lpt1".<br/>then i hit enter key, cmd will send my file...But what happens if your filename is too long for the available "blank space" in your request?<br/>so i cannot insert any file name??<br/>or any way to allow user drag and drop file over, then it will inserted ?what's wrong with the PRINT command?<br/>1. Save to desktop as .bat or .cmd file (name as you like)<br/>2. To use, drag and drop file onto icon.<br/><br/> Code: <a>[Select]</a>copy "%1" lpt1:I use this<br/>copy "%1" lpt1:<br/>pause<br/><br/> but not working<br/><br/>The system cannot find the file specified.<br/><br/><a href="https://interviewquestions.tuteehub.com/tag/c-3540" style="font-weight:bold;" target="_blank" title="Click to know more about C">C</a>:\&gt;pause<br/>Press any key to continue . . . Code: <a>[Select]</a>copy "%~dpnx1" lpt1:copy "%~dpnx1" lpt1:<br/>not working too............ Code: <a>[Select]</a>echo off<br/>echo File to copy: "%~dpnx1"<br/>pause<br/>copy "%~dpnx1" lpt1:<br/>pause<br/><br/>Please post what you see on screen (by copying and pasting)<br/>File to copy: "C:\urban.txt"<br/>Press any key to continue . . .<br/><br/>nothing happend when i press any keyYou <a href="https://interviewquestions.tuteehub.com/tag/sayaeur-637418" style="font-weight:bold;" target="_blank" title="Click to know more about SAY">SAY</a> "nothing happened". Please say what you are <a href="https://interviewquestions.tuteehub.com/tag/expecting-7262936" style="font-weight:bold;" target="_blank" title="Click to know more about EXPECTING">EXPECTING</a> to happen.<br/><br/>a. Is "C:\urban.txt" the file you dragged and dropped? (i.e. are the path and filename correct?)<br/>b. Does your computer have a parallel port which is enabled in the BIOS and is there a device such a printer properly connected to it and switched on?<br/>c. Do you get to the second Press any key message?<br/>d. What operating system are you running?<br/><br/>Please try this and post results as before...<br/><br/> Code: <a>[Select]</a>echo off<br/>echo 1 File to copy: "%~dpnx1"<br/>pause<br/>echo 2 Copying file to printer port<br/>copy "%~dpnx1" lpt1:<br/>echo 3 Printer finished<br/>pause<br/><br/><br/> Quote from: Salmon Trout on July 25, 2010, 12:53:59 AM</p><blockquote>You say "nothing happened". Please say what you are expecting to happen.<br/><br/>a. Is "C:\urban.txt" the file you dragged and dropped? (i.e. are the path and filename correct?)<br/>yes, i drag and drop, both .bat and urban.txt are located at desktop<br/>b. Does your computer have a parallel port which is enabled in the BIOS and is there a device such a printer properly connected to it and switched on?<br/>i think i found the problem, now i <a href="https://interviewquestions.tuteehub.com/tag/change-238106" style="font-weight:bold;" target="_blank" title="Click to know more about CHANGE">CHANGE</a> my adobe print to lpt1...semms working...<br/>c. Do you get to the second Press any key message?<br/>yes<br/>d. What operating system are you running?<br/>XP<br/> Code: <a>[Select]</a>1 File to copy: "C:\urban.txt"<br/>Press any key to continue . . .<br/>2 Copying file to printer port<br/>        1 file(s) copied.<br/>3 Printer finished<br/>Press any key to continue . . .</blockquote> how to make the cmd do not close after i press any key?<br/>so i can drag and drop the file while cmd window open...</body></html>


Discussion

No Comment Found