DOS File Name question

us3rnotfound

Diamond Member
Jun 7, 2003
5,334
3
81
Setup.exe starts, then spawns a new temporary process that invariably begins with "~TMP"____, and closes itself.

For example, that child exe might be called ~TMP2324sdf.exe, or another time it might be called ~TMPsadf3.exe, etc, point is I know it will be ~TMPsomething.

I'm doing a search in the task manager for this ~TMP process, so that when it closes, the batch file will go to the next line. I've got that part down ok, it's just the temporary exe process and how do handle its filename in a search that is throwing me off.

My question is, how do you specify in a batch file a filename if you only know part of it? I've been trawling Google, but with no luck so far, I know it's a fairly common thing to do.

My intuition said to specify set*.exe, and that'd open setup.exe for instance. I know it involves an asterisk at some point, could someone give me a quick hint?

Thanks.
 

MerlinRML

Senior member
Sep 9, 2005
207
0
71
You can specify filenames with the asterisk wildcard. In your example, this would be
Code:
copy ~TMP*.exe c:\dest\

As an alternative, you can pipe commands to find if you want to find the specific instances of strings within the output of commands.
Code:
dir | find /i "~TMP"