views:

90

answers:

1

I have a complicated batch file (under windows), let's call it BigMess.bat. It makes a lot of actions that I would like to monitor (especially the copy/move actions). I wouldn't like to touch the BigMess.bat.

Is it possible to redirect the calls to move/copy to my own application or another batch file?

I tried putting a move.bat file beside the BigMess.bat but it prefers the shell's move. Is it feasible WITHOUT touching BigMess.bat?

+2  A: 

if you run BigMess.bat with cmd.exe - no chance. as stated in The Windows NT Command Shell - Command Search Sequence:

If the command name [eg. move, copy] does not specify a path, the shell attempts to match the command name against the list of internal shell commands. If a match is found, the internal command executes.

it might be possible by using another shell. have a look at Take Command. it has a) cmd.exe compatibilty, and b) aliases. aliases are expanded before internal commands, so you could use one like

alias copy=C:\path\to\your\monitor\app

good luck!

ax