Startup Directory in Program Execution Task Properties

GuyS (45 posts)
November 10, 2021 02:17 PM
Accepted Answer

Hi,

I need to run a .cmd file, running in it's own folder. I thought I could manage that by filling the Startup Directory. But it results in a 'NOT FOUND'.

I can solve the problem by specifying the full pathname as Target, which will run the .cmd, but the cmd seems to fail because it is not running i it's own folder-environment. Not sure this is a good discription.

In other words, when I open a CMD-window, change the folder to the folder where the .cmd is located, and run it, it will succeed. When I run it in adTempus, it failes.

 

Any idea?

 

Thanks,

Guy Swagten

The Netherlands

and still a big fan of adTempus

 

Attachments

This topic has an accepted answer. Jump to it.
Bill Staff (599 posts)
November 10, 2021 03:05 PM
Accepted Answer

You always need to include the path to the executable in the Target box--adTempus will not automatically use the path from the Startup Directory.

If your batch file depends on being run from a specific path (as yours does) you need to specify the path in the Startup Directory. This is equivalent to changing to the directory before running the program in the command window.

In short, in your case you need a path in both the Target and the Startup Directory.

GuyS (45 posts)
November 11, 2021 05:10 AM
Accepted Answer

Thanks Bill,

I think my problem is that the .exe, run in the .cmd file, opens a kind of progress-screen. That's something that might be a problem when I try to run it in adTempus.

 

Guy 

Bill Staff (599 posts)
November 11, 2021 07:26 AM
Accepted Answer
It should be OK if it shows a progress screen, unless it's showing a dialog box that you have to click something in. You can try forcing the job to run in visible mode and see if the program shows an error. See this article.

Replies are disabled for this topic.