0

I would like to create a batch script to call an .exe file but the path to that .exe file is changed everyday.

i.e.: the first day it should call

\\dfs\ns1\Application_Data\AutoProcess\Int\file.exe

then the second day it should call

\\dfs\ns1\Application_Data\AutoProcess\Int2\file.exe

and so on.

Is there a way to make this happen?

irolfi
  • 1
  • 3
  • Possible duplicate of [Find file and return full path using a batch file](https://stackoverflow.com/questions/13876771/find-file-and-return-full-path-using-a-batch-file) – Robin Oct 17 '17 at 13:34
  • 1
    On day 2 does the executable still in exist in the path for day 1? – Squashman Oct 17 '17 at 13:39
  • On day 2, the executable does not exist anymore in the path of Day 1. – irolfi Oct 17 '17 at 13:43
  • 1
    The duplicate answer that @Destan provided should work. One other options is to use the `WHERE` command within a `FOR /F` command. `FOR /F "delims=" %%G IN ('where /r \\dfs\ns1\Application_Data\AutoProcess file.exe') do set fpath=%%G` – Squashman Oct 17 '17 at 14:01
  • Please [edit] your question to show [the code you have so far](http://whathaveyoutried.com). You should include at least an outline (but preferably a [mcve]) of the code that you are having problems with, then we can try to help with the specific problem. You should also read [ask]. – Toby Speight Oct 17 '17 at 14:36

0 Answers0