Jump to content

Quick Try


Recommended Posts

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 by Lori
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...