I currently have a script that uses the following to run the main batch file using a remote CMD application:
cd c:/remoteinstallers & ME_Unavailable_Fix
However when running this remotely it will default to my own user profile as the first line of the batch file contains:
cd/D "%UserProfile%"
Is there any way to cd to the current logged in user and then continue the rest of the script from there instead of it automatically looking for my own profile?
I have tried using the following but do not know if it would be possible to store the UserName variable and then CD to them from here
WMIC /node:"computername/IPAddress" COMPUTERSYSTEM GET USERNAME