![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| OpenSource Software For the Discussion of Opensource CAD/CAM and NC shareware software etc) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| DOS Prompt ? Maybe a bit off topic but there should be some programmers around here. OS is XP Pro x64 I have a small .bat program I am trying to run from the right click menu. It works fine but it hangs up in the dos screen, no prompt showing, I hit enter and it completes and the text shows up in the Windows clipboard. Any ideas on how to get it to not wait for the enter key. Code: @echo off set /p = %1 | clip exit Last edited by Andre' B; 09-03-2008 at 05:17 PM. |
|
#2
| |||
| |||
| You might try redirecting the input from the console to a file, using the redirection operator '<' The file would consist of a single character, ASCII 13. A simple way to generate the file is to type in the following at the DOS prompt: COPY CON: C:\EOL.TXT [ENTER] [ENTER] [CTRL-Z] [ENTER] This creates the file "C:\EOL.TXT" ( a two-byte file, ASCII 13 & ASCII 10 )
__________________ Diplomacy is the art of saying "Nice doggie" until you can find a rock. - Will Rogers Last edited by Eurisko; 09-04-2008 at 07:51 PM. Reason: clarification |
|
#3
| |||
| |||
| What I am trying to do is take whatever is in parameter %1 when the bat file is called and put it on the windows clipboard without changing it. echo %1 | clip Works but adds the linefeed/carriage return at the end. set /p = %1 | clip Does not change the text at all, unless the user types something other then just the Enter key, but it waits for the user input. |
|
#4
| ||||
| ||||
| Back when I fooled around with scripting in bobcad, we'd have to use some sort of string search to get individual characters from a source, minus any formatting characters. I have no idea how you'd do this with DOS commands though.
__________________ First you get good, then you get fast. Then grouchiness sets in. (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#5
| |||
| |||
| Andre' B, Create the EOL.TXT file (2 bytes) and place it in the same directory as your batch file. Change the line in the batch file set /p= %1 | clip TO set <eol.txt /p=%1 | clip This does exactly what you wanted, copies the parameter to the clipboard with no linefeed and returns to the DOS prompt without user input.
__________________ Diplomacy is the art of saying "Nice doggie" until you can find a rock. - Will Rogers |
| Sponsored Links |
|
#6
| |||
| |||
| Ah. Lightning strikes. I must have miss read your first reply as redirecting the output to a file. Not on the x64 system at the moment but your solution works on a XP Pro system, at least after I put the clip.exe program on it. I wanted somthing that works like clippath but without the extra mouse click to select the type of path. And clippath does not seem to work on the x64 system. Thanks, for the help. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |