Okay, here is the scenario. We are making some network changes where I work and would otherwise have to touch each PC to do this. I created a batch file with the code below. Obviously with our dns settings and admin password inserted.
@echo off
>nul wmic nicconfig where (IPEnabled=TRUE) call SetDNSServerSearchOrder ("DNS1", "DNS2")
>nul net user Administrator NEWADMINPASSWORD
2>nul net localgroup administrators /delete "Domain Users"
The batch file runs just fine from both the local C: directory and the network location it is stored on, but when running as a task it fails. It was my understanding that when running a script at login it runs under the system account and thus shouldn't get denied access.
Any help would be greatly appreciated. Thanks.