I am trying to rename a computer name on a Windows Embedded POS Ready 2009 OS. I am trying to update the computername with the following syntax:
:: COMPUTER NAME CHANGE OUTPUT TO POWERSHELL FILE
echo $sysInfo = Get-WmiObject -Class Win32_ComputerSystem >> ComputerName.ps1
echo. >> ComputerName.ps1
echo $sysInfo.Rename("%PCNAME%") >> ComputerName.ps1
:: CALL POWERSHELL FILE TO RENAME COMPUTER
REM Powershell.exe set-executionpolicy unrestricted > output_ps.txt
REM PowerShell.exe -File ComputerName.ps1 >> output_ps.txt
echo COMPUTER NAME WILL CHANGE TO %PCNAME% AFTER RESTARTING THE COMPUTER
Ping -n 2 127.0.0.1>nul
I restart the computer, and sadly this does not appear to rename the computer. This is working on all other OS'es except for the Windows Embedded POS Ready 2009 OS.
Any ideas why this works on XP and others, but not this OS?