ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec.vi

PC is running Windows10.

I'm usingLabVIEW 2017.

I  have installed PdfCreator v, 4.4.0  (free version).

When i run 

               PDFcreator-cli.exe

from a Windows shell, I got:

 

cmdprompt.png

 

But if I run the same sw using "System Exec.VI" I got:

 

Diag_LVSystemExec.png

FP_LVSystemExec.png

 

Can anyone give me some hints?

0 Kudos
Message 1 of 9
(3,509 Views)

Have you tried putting 'cmd /c' at the beginning of the command line input?

aputman_0-1751561015578.png

 

aputman
Message 2 of 9
(3,484 Views)

You could use the example that is provided by NI:

aeastet_0-1751564443032.png


I believe aputman is correct on the need for cmd /c to make this work. 

Tim
GHSP
Message 3 of 9
(3,464 Views)

Ty aputman.

 

 I think you are right, but putting "cmd /c" before the .exe name, don't change the result.

0 Kudos
Message 4 of 9
(3,425 Views)

Hey aeastet.

I forgot to check the examples!

 

Anyway, I posted  a simplified version of the problem.

 

LabVIEW create a batch file (.bat), in which some files are moved in a folder, and then  PDFCreator-cli.exe merge some .pdf files.

LabVIEW call System Exec.vi to run the batch file.

 

When I run LabVIEW .vi,  i got that files are correctly  moved as I expected, but .pdf are not merged.

The call to System Exec.vi, always return in standard error:

 

Unhandled Exception: System.IO.IOException: The handle is invalid.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at pdfforge.PDFCreator.UI.CLI.Program.ConfigureParser()
at pdfforge.PDFCreator.UI.CLI.Program.<Main>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at pdfforge.PDFCreator.UI.CLI.Program.<Main>(String[] args)



 

Running the batch file manually, doubleclicking on it, always works fine.

 

bye

 

In the standard error output there is always the same message:

0 Kudos
Message 5 of 9
(3,413 Views)

Add the correct path as Start/default folder. Since Windows 7 it's been pickier about that.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 6 of 9
(3,395 Views)

Hi Yamaeda,

I don't know exactly what "correct path" mean, but I think that the problem can be related to  access privileges to system folders..., so I tried copying the full tree of

     c:\program files\PDFCreator

to

    d:\PDFCreator

Then i ran the PDFCreator-cli.exe from the new path, but I got the same error.

 

ty

bye

0 Kudos
Message 7 of 9
(3,354 Views)

Other alternative to consider:

1. Create a batch file, put your command in it.  Make sure it works in Windows.  Call the batch file using System Exec.vi

Or

2. Create a shortcut, configure it properly (for example: run as admin, etc.).  Call it in System Exec.vi.

 

George Zou
Message 8 of 9
(3,333 Views)

@NoShelter wrote:

Hi Yamaeda,

I don't know exactly what "correct path" mean, but I think that the problem can be related to  access privileges to system folders..., so I tried copying the full tree of

     c:\program files\PDFCreator

to

    d:\PDFCreator

Then i ran the PDFCreator-cli.exe from the new path, but I got the same error.

 

ty

bye


Sorry for the delay, i've been on vacation. 🙂

In your examples, try setting D:\PDFCreator as Working directory input. 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 9
(515 Views)