I have a simple batch file that copies three files to my \%windir%\syswow64 directory and then does a regsvr32 on these three files. The problem is, when I just run the batch file normally, it gives me an access denied error as Windows doesn't allow non-elevated copy commands to the syswow64 directory. So then, you would think that you could just right click on the batch file and say "run as administrator". The problem then is that when you run a batch file with elevated admin rights, it changes the current directory path for some reason and it can no longer find the files I am trying to copy! How do I fix this? Is there a way to reset the current directory in my batch file before it gets to the copy lines?
So just to clarify, I have a folder on the root (it could be anywhere) of my c:\ drive. In this folder is the batch file and the three files I want to copy. When I run the batch file as administrator, it changes the directory in the command prompt to c:\windows\system32 and it obviously cannot find the three files it needs to copy since they are not in the system32 folder to begin with.