I am working on a script that is gonna ease the domain migration of 100+ computers, one of the steps in the script is to create a local account and add it to the local administrators group.
This all works fine on my test machine running english windows, but on a Swedish OS where the Administrator group is called "Administratörer" it doesnt find the group because it misinterprets the letter Ö.
Here is a short script demonstrating the same problem but when adding a user with Ö in the name. The result will be a user called "tempadmin÷"
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#include <Constants.au3>
#include <MsgBoxConstants.au3>
$RunPid=Run(@ComSpec & ' /K', '',"",$STDIN_CHILD + $STDOUT_CHILD + $STDERR_CHILD)
Sleep(1500)
StdinWrite($RunPid, 'Net User ' & "tempadminö" & ' ' & "secretpassword" & ' /add' & @CRLF)
Sleep(2000)
$result=StdoutRead($RunPid)
StdinWrite($RunPid)
ProcessClose($RunPid)
MsgBox(4096,"test",$result)
I have tried playing around with chcp and cmd /U, cmd /A but haven't really gotten any where, is there anyone that can nudge me in the right direction?
FYI: to my knowledge this script must be compiled and then run as admin before it will create any user.