Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Frank_Hartmann
Master II
Master II

EXECUTE command in script

Hi,

i try to execute an exe file from the script.

EXECUTE cmd /c "..\..\..\Test.exe";

It works but there is always the cmd window popping up.

is there any parameter for the Execute command to hide this cmd.exe window?

1 Solution

Accepted Solutions
marcus_sommer

Maybe it could be an alternatively if you triggerred a windows task which is then executing the origin task. I mean something like:

EXECUTE schtasks.exe /Run /TN "QlikView Tasks\Your Task";

- Marcus

View solution in original post

8 Replies
marcus_sommer

It seems that there isn't such parameter for the cmd but various workarounds:

https://www.administrator.de/frage/unterdr%C3%BCcken-dos-fenster-ausf%C3%BChren-batchdatei-5624.html

- Marcus

Frank_Hartmann
Master II
Master II
Author

Hi Marcus,

thank you for your response.

As far as I could test it the proposals in your link only works for batch files. I managed to create a batchfile which is not popping up with cmd.exe (but only if i execute the batch file directly from the folder).  if i execute the same from QV Script then the cmd.exe window pops up again. I guess this might not be possible in QV

marcus_sommer

Maybe it could be an alternatively if you triggerred a windows task which is then executing the origin task. I mean something like:

EXECUTE schtasks.exe /Run /TN "QlikView Tasks\Your Task";

- Marcus

Frank_Hartmann
Master II
Master II
Author

Hallo Marcus.

ich habe nun einen Windows Task erstellt den ich in der Aufgabenplanung sehen und starten kann.

Der Task wurde im Ordner C:\Windows\System32\Tasks\StartProgramm gespeichert. Allerdings funktioniert der von dir genannte Befehl bei Skriptausführung nicht. Es tut sich nichts, das Skript läuft weiter ohne den Task zu starten.

Muss ich da noch etwas beachten?

Danke und Gruß Franky

Frank_Hartmann
Master II
Master II
Author

Hallo Marcus,

mit dem Befehl funktioniert es nun.

EXECUTE schtasks.exe /Run /TN "StartProgramm";


Und es poppt auch kein CMD Fenster mehr auf 🙂


Jetzt habe ich aber das Problem, dass mein Script nicht wartet bis das Programm durchgelaufen ist. Vorher war dies der Fall. Hast du eine Idee?


Gruß Franky

marcus_sommer

Hallo Franky,

nicht wirklich (eine gute) - vielleicht ist ja etwas wie ein Sleep 5000; Statement nach dem EXECUTE praktikabel genug.

Schöne Grüße

Marcus

Frank_Hartmann
Master II
Master II
Author

Ja, daran habe ich auch gedacht. Dann werde ich den Sleep großzügig einrichten und hoffen das

es hält 🙂

Danke für deine Hilfe

Gruß Franky

SimonAichmayr
Partner - Contributor
Partner - Contributor

Hallo Frank,

wie hast du die Test.exe zum Laufen bekommen? Ich habe alle notwendigen Einstellungen gemacht und ich bekomme auch keinen Fehler, wenn ich das Execute ausführe, doch es passiert einfach nichts. 

Mir kommt es vor als würde er meine Exe (.Net Console App) überspringen.

 

LG Simon