I've been working on a batchfile script for a few weeks now that should automate certain routine tasks I need to perform during my work. However, I've stumbled upon a problem which I haven't been able to figure out yet.
I'm using a USB Stick that carries the script and some other software (.exe's). The script requires you to run it in administrator mode so that it can access certain services like Windows Time Service or Windows Update service...
Now I've noticed that when you run the script in administrator mode, It's starting directory is C:\Windows\System32
During this script I wish to run a program that is also on the stick. However it does not find this program. I could write the path to the exact location on the stick. But that will not work because the stick is used on different computers and the drive letter does not always match.
Long story short, I'm looking for a way to run a batch file (that is located on a USB Device) in administrator mode and have that script run a program (Also on the USB Device) automatically.
Thanks in advance! Dempsey
PS: If possible would someone be able to explain how I can make the script log everything to a text file? Keep in mind that the script has a lot of commands in it. It would be nice to have all the output logged into a text file and saved on that same USB Device.