I am mostly new to this kind of stuff and running into a problem I don't know how to solve. Basically, it's looking at test.txt and using the list of computer names inside it, and running the batch file on each of them. If I could figure out a way to plug in the remote computer name I would be good to go but I don't know how to do that. I have researched a bit and saw that some people say you can use %COMPUTERNAME^% with the ^ giving it the ability to return the remote computer name rather than the one I'm running the command from. This works if I do something like:
psexec @c:\test.txt cmd /c echo %COMPUTERNAME^%
However, if I try to use that in the path of the file I want to run it does not work and just tries to use "%COMPUTERNAME%" as the actual name instead of resolving it. Here is the command I'm trying to use:
psexec @c:\test.txt elevate \\%COMPUTERNAME%\c$\IE10fix.bat
I'm trying to run this batch file on a long list of computer names, and it must be run as local administrator which is why I'm using elevate. If anyone can provide a solution to the remote computer name issue, or even another approach all together I would be very thankful.