mojamoja
mojamoja

Reputation: 23

Batch file to open new file in directory?

I have in C:\files\ for example the following files:

apple.txt
orange.doc
banana.exe
kiwi.avi

And I place e.g. mango.exe in there.

What script or technique can I use to be notified immediately of the change to this folder and to open the file immediately?

Upvotes: 2

Views: 173

Answers (2)

xan
xan

Reputation: 7568

For a batch file, this answer may help:

batch file to monitor additions to download folder

You would need to extend the solution there yourself to launch the detected changes.

In C# this can be done quite easily. This question: How can I monitor a Windows directory for changes? is similar.

Upvotes: 1

Marc B
Marc B

Reputation: 360872

move \wherever\mango.exe c:\files\mango.exe
start mango.exe

Upvotes: 0

Related Questions