How do you move and execute an exe in sub dir

July 12, 2011 at 14:03:23
Specs: Windows Vista, 2.501 GHz / 3581 MB
I need to move a .exe from one sub dir to another and execute in each one. Help Please. Currently have to move the exe to the desired directory and use command prompt to execute exe.

See More: How do you move and execute an exe in sub dir

Report •


#1
July 12, 2011 at 14:04:58
Why do you need to move the .exe to execute it? Why not just keep it in one place?

Report •

#2
July 12, 2011 at 14:19:45
Each sub dir contains two files that the exe needs to work on. Files that the exe needs to work on are the same name in each sub dir yet they have dif info.

Report •

#3
July 12, 2011 at 14:27:27
But the executable file doesn't need to be in the same directory as the files it is working on.

Change into the directory where the files are located then either (1) specify the full pathname when running the executable, or (2) put the executable in a directory included in the PATH environment variable; then you will be able to just call it by name.


Report •

Related Solutions

#4
July 12, 2011 at 14:53:45
Learning as I read your posts. So a code that would go through each sub dir and called the exe would something like....what?

for %%f in (sysvars) DO (call kconvars.exe sysvars system.va)

These are the known variables:
exe = kconvars.exe
file1 = sysvars
file2 = system.va

Thank You


Report •

#5
July 12, 2011 at 17:29:28
move "%cd%\your.exe" "[drive]New Dir"

Report •

#6
July 12, 2011 at 17:34:01
frogot
your.exe

Then you copy/past the lines replacing "[drive]New Dir" for each.


Report •

#7
July 12, 2011 at 18:48:44
Example:
Directory = Alphabet
Sub dirs are...yep...A thru Z
Inside each one are two files that i need to run the .exe on (some kind of converter)

What would the code be to loop through the sub dirs?

Looking for a batch file


Report •

Ask Question