Command line tool scripts / Windows 10

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
BastelFritz
Active Member
Posts: 25
Joined: Sun Apr 07, 2019 7:30 pm

Command line tool scripts / Windows 10

Post by BastelFritz » Sat Apr 13, 2019 10:32 am

I try to follow this tutorial:
https://qcad.org/de/tutorial-command-li ... rten%C2%A0


It does not start. After looking for issues with spaces etc I came finally to the point, that even qcad -h does not work as expected:
Unbenannt.JPG
Unbenannt.JPG (24.25 KiB) Viewed 2646 times
I opened a cmd shell (this time as administrator), cd to the QCAD directory and show the Windows version.

Next line I try displaying the help text, but no echo.

Then I type only "qcad" - this launches QCAD perfectly. It works also to open a drawing.


Should this be possible on a Windows 10 computer?


Version:
3.22.0.0 (3.22.0)
Internet:
QCAD.org
Erstellungsdatum:
Mar 1 2019
Revision:
2ba5a26
Qt Version:
5.5.1
Architektur:
x86_64
Compiler:
MSVC++ 12.0 (2013)

User avatar
andrew
Site Admin
Posts: 9052
Joined: Fri Mar 30, 2007 6:07 am

Re: Command line tool scripts / Windows 10

Post by andrew » Sat Apr 13, 2019 11:12 am

Windows applications can only either provide a graphical user interface or command line output, not both. To see the output of a command line tool, please stream it to a file and then output the file:

Code: Select all

qcad -h 1>log 2>&1
type log
The standard QCAD command line tools also do that in their batch file launch scripts:

Code: Select all

qcad.exe -no-gui -allow-multiple-instances -autostart scripts\Pro\Tools\Dwg2Pdf\Dwg2Pdf.js %0 %* 1>%temp%\dwg2pdf.log 2>&1
type %temp%\dwg2pdf.log
del %temp%\dwg2pdf.log

BastelFritz
Active Member
Posts: 25
Joined: Sun Apr 07, 2019 7:30 pm

Re: Command line tool scripts / Windows 10

Post by BastelFritz » Sun Apr 14, 2019 8:19 am

andrew wrote:
Sat Apr 13, 2019 11:12 am
Windows applications can only either provide a graphical user interface or command line output, not both.
This was the crucial hint. I could sort out my initial errors quickly afterwards.

Thank you for posting detailed answer with piping command, works like a charme now.

Post Reply

Return to “QCAD 'How Do I' Questions”