取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 9 条)
3,425 次查看

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

aputman_0-1751561015578.png

 

aputman
2 条消息(共 9 条)
3,400 次查看

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
3 条消息(共 9 条)
3,380 次查看

Ty aputman.

 

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

0 项奖励
4 条消息(共 9 条)
3,341 次查看

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 项奖励
5 条消息(共 9 条)
3,329 次查看

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
6 条消息(共 9 条)
3,311 次查看

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 项奖励
7 条消息(共 9 条)
3,270 次查看

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
8 条消息(共 9 条)
3,249 次查看

@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 项奖励
9 条消息(共 9 条)
431 次查看