I have received a warning that this is a too "subjective" question, but I can't really find another way to say this in a text as short as a title, so my apologies… any suggestions for a title are appreciated.
So on to my question, yesterday I tried to code something and I failed, simple as that… after several hours of searching for the problem, I still couldn't find it: so in hopes of finding a solution, I am asking, how would you have done it?
Goal:
There is a file called a.bat in the F:\ directory, that needs to be moved to the C:\Users directory when clicked upon, and since the act of moving would disrupt the file, it needs to be re-started from the C:\Users directory after the move. So we need to code a batch within a batch, right?
One that would form when a.bat is clicked, and do the move as well as launching a.bat when the move is finished. Now I can't seem to do it, the code just does not work. It creates a loop of CMDs that forces me to restart the computer, even though it seems like a simple task — and yes I did if %cd% == C:\Users goto z, which would skip creating the batch that would do the move, if the file is already in that directory.
Best Answer
If I'm understanding the question you might try something like this:
NOTE:
The batch file will have to run as an admin in order to make a copy in C:\Users unless the permissions of C:\Users have been changed to allow standard users to write to the folder.