Lori Posted June 4, 2009 Posted June 4, 2009 (edited) I've removed the user and domain details for posting on here, everything works except the _RunDOS command. But I can't see where it's going wrong? Netdom is installed and it works under dos ok. (with the change to how varables are delt with) #include <process.au3> $return = MsgBox(0x4+48, "Rename?", "Would you like to rename this machine?", 10) If $return=6 Then $Machinename = Inputbox("Rename", "Rename me to...", "", "") If @error then Exit _RunDOS("netdom renamecomputer %computername% /NewName:" & $Machinename & "/Force /REBoot:2 /UserD: /PasswordD:") EndIf If $return=7 Then $return = MsgBox(0x4+48, "Join Domain?", "Would you like to join the domain?", 10) if @error then Exit if $return=6 Then _RunDOS("netdom join computername /Domain: /UserD: /PasswordD: /REBoot:2") EndIf If $return=7 Then EndIf EndIf Exit Edited June 4, 2009 by Lori
Skruge Posted June 4, 2009 Posted June 4, 2009 Welcome to the forums. Here you need a space between the new Machine Name and the /Force switch: _RunDOS("netdom renamecomputer %computername% /NewName:" & $Machinename & "/Force /REBoot:2 /UserD: /PasswordD:")computername should be %computername%_RunDOS("netdom join computername /Domain: /UserD: /PasswordD: /REBoot:2")_RunDOS doesn't have any debugging options. Try one (or both) of these lines instead:RunWait(@Comspec & " /k echo " & "Your Command Goes Here") ; View the command as it will be executed. RunWait(@Comspec & " /k " & "Your Command Goes Here") ; Run the command and see the output (if any). [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
sb1920alk Posted June 25, 2009 Posted June 25, 2009 I wasn't aware netdom could rename computers while they aren't on a domain.
Skruge Posted June 25, 2009 Posted June 25, 2009 I wasn't aware netdom could rename computers while they aren't on a domain.It can't...But whoever said that it could? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
sb1920alk Posted June 25, 2009 Posted June 25, 2009 It can't...But whoever said that it could?The op's script example looks like the "rename" is before the "join" to me.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now