I have a simple script to join an AD domain and rename the computer. When I execute these commands directly on the CLI, it works fine.
When I execute the same via batch file, I get an error saying
The network path was not found
I am running as Administrator with full privileges. I have googled around microsoft forums but my case is unique because it works from the CLI and not from the batch file
netdom join %%computername%% /domain:OPSCODEDEMO.COM /userd:Administrator /passwordd:xxx netdom renamecomputer %%computername%% /NewName:%hostname% /Force
The environment is Windows 2k8 R2 SP1 running on Ninefold Cloud (Xenserver).