Discussion:
Shortcut to open ComputerNam/Domain Changes property window
(too old to reply)
Thee Chicago Wolf [MVP]
2014-12-19 17:30:42 UTC
Permalink
Hey all,

It's simple enough to run sysdm.cpl to open System Properties, but how
does one open to the Computer Name/Domain Changes property window?
This is the same window that appears when pressing the Change button
on the System Properties "Computer Name" tab.

Doing some Google searching, "control sysdm.cpl,,1 -1" was supposed to
do it but it doesn't work on Win 7. Anyone have some good advice on
this problem?

- Thee Chicago Wolf [MVP]
JJ
2014-12-20 11:41:42 UTC
Permalink
Post by Thee Chicago Wolf [MVP]
Hey all,
It's simple enough to run sysdm.cpl to open System Properties, but how
does one open to the Computer Name/Domain Changes property window?
This is the same window that appears when pressing the Change button
on the System Properties "Computer Name" tab.
Doing some Google searching, "control sysdm.cpl,,1 -1" was supposed to
do it but it doesn't work on Win 7. Anyone have some good advice on
this problem?
- Thee Chicago Wolf [MVP]
You'll have to use AutoIt or VBScript script.
The "control sysdm.cpl,,1 -1" only open the System control panel at specific
tab. It doesn't automate the button press.

With AutiIt:

Run("control sysdm.cpl,,1 -1")
WinWaitActive("System Properties")
Send("!c")

i.e.: First line will run the control panel. Second line will wait until its
window is shown and activated. Third line will send the ALT+C keystroke to
the current active window.

With VBScript:

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "control sysdm.cpl,,1 -1"
WScript.Sleep 1000 '...must adjust the delay!
WshShell.AppActivate "System Properties"
WScript.Sleep 100
WshShell.SendKeys "%c"

But one problem with VBScript is that it doesn't have a function to check
the current active window. So, the WshShell.AppActivate doesn't return any
error when it fails. For example, WshShell.AppActivate was executed when the
window has not been created (i.e. the delay after running the control panel
applet is too small).
Thee Chicago Wolf (MVP)
2014-12-20 19:59:41 UTC
Permalink
Post by JJ
Post by Thee Chicago Wolf [MVP]
Hey all,
It's simple enough to run sysdm.cpl to open System Properties, but how
does one open to the Computer Name/Domain Changes property window?
This is the same window that appears when pressing the Change button
on the System Properties "Computer Name" tab.
Doing some Google searching, "control sysdm.cpl,,1 -1" was supposed to
do it but it doesn't work on Win 7. Anyone have some good advice on
this problem?
- Thee Chicago Wolf [MVP]
You'll have to use AutoIt or VBScript script.
The "control sysdm.cpl,,1 -1" only open the System control panel at specific
tab. It doesn't automate the button press.
Run("control sysdm.cpl,,1 -1")
WinWaitActive("System Properties")
Send("!c")
i.e.: First line will run the control panel. Second line will wait until its
window is shown and activated. Third line will send the ALT+C keystroke to
the current active window.
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "control sysdm.cpl,,1 -1"
WScript.Sleep 1000 '...must adjust the delay!
WshShell.AppActivate "System Properties"
WScript.Sleep 100
WshShell.SendKeys "%c"
But one problem with VBScript is that it doesn't have a function to check
the current active window. So, the WshShell.AppActivate doesn't return any
error when it fails. For example, WshShell.AppActivate was executed when the
window has not been created (i.e. the delay after running the control panel
applet is too small).
Thanks much for the reply. I tried to plug that VBScript into notepad
and save as a .vbs but when I ran it, nothing popped up.
Dave-UK
2014-12-20 21:39:02 UTC
Permalink
Post by Thee Chicago Wolf [MVP]
Hey all,
It's simple enough to run sysdm.cpl to open System Properties, but how
does one open to the Computer Name/Domain Changes property window?
This is the same window that appears when pressing the Change button
on the System Properties "Computer Name" tab.
Doing some Google searching, "control sysdm.cpl,,1 -1" was supposed to
do it but it doesn't work on Win 7. Anyone have some good advice on
this problem?
- Thee Chicago Wolf [MVP]
There seems to be too many commas in the command.
I created a batch file with this single line and it works ok here.

control sysdm.cpl,1 -1
Dave-UK
2014-12-20 21:48:04 UTC
Permalink
Post by Dave-UK
Post by Thee Chicago Wolf [MVP]
Hey all,
It's simple enough to run sysdm.cpl to open System Properties, but how
does one open to the Computer Name/Domain Changes property window?
This is the same window that appears when pressing the Change button
on the System Properties "Computer Name" tab.
Doing some Google searching, "control sysdm.cpl,,1 -1" was supposed to
do it but it doesn't work on Win 7. Anyone have some good advice on
this problem?
- Thee Chicago Wolf [MVP]
There seems to be too many commas in the command.
I created a batch file with this single line and it works ok here.
control sysdm.cpl,1 -1
Oops, forget that. It just opens at the first tab. Sorry. :-(
Thee Chicago Wolf (MVP)
2014-12-20 22:31:27 UTC
Permalink
Post by Dave-UK
Post by Dave-UK
Post by Thee Chicago Wolf [MVP]
Hey all,
It's simple enough to run sysdm.cpl to open System Properties, but how
does one open to the Computer Name/Domain Changes property window?
This is the same window that appears when pressing the Change button
on the System Properties "Computer Name" tab.
Doing some Google searching, "control sysdm.cpl,,1 -1" was supposed to
do it but it doesn't work on Win 7. Anyone have some good advice on
this problem?
- Thee Chicago Wolf [MVP]
There seems to be too many commas in the command.
I created a batch file with this single line and it works ok here.
control sysdm.cpl,1 -1
Oops, forget that. It just opens at the first tab. Sorry. :-(
Right. And you don't even need the -1 in there to do the same task.
Dave-UK
2014-12-20 22:44:09 UTC
Permalink
Post by Thee Chicago Wolf (MVP)
Post by Dave-UK
Post by Dave-UK
Post by Thee Chicago Wolf [MVP]
Hey all,
It's simple enough to run sysdm.cpl to open System Properties, but how
does one open to the Computer Name/Domain Changes property window?
This is the same window that appears when pressing the Change button
on the System Properties "Computer Name" tab.
Doing some Google searching, "control sysdm.cpl,,1 -1" was supposed to
do it but it doesn't work on Win 7. Anyone have some good advice on
this problem?
- Thee Chicago Wolf [MVP]
There seems to be too many commas in the command.
I created a batch file with this single line and it works ok here.
control sysdm.cpl,1 -1
Oops, forget that. It just opens at the first tab. Sorry. :-(
Right. And you don't even need the -1 in there to do the same task.
JJ's AutoIt script works.
I've used AutoIt to make a little exe file.

http://www.mediafire.com/download/lw9lb6bgsx6j3kh/domain.zip
Thee Chicago Wolf (MVP)
2014-12-21 14:12:47 UTC
Permalink
Post by Dave-UK
Post by Thee Chicago Wolf (MVP)
Post by Dave-UK
Post by Dave-UK
Post by Thee Chicago Wolf [MVP]
Hey all,
It's simple enough to run sysdm.cpl to open System Properties, but how
does one open to the Computer Name/Domain Changes property window?
This is the same window that appears when pressing the Change button
on the System Properties "Computer Name" tab.
Doing some Google searching, "control sysdm.cpl,,1 -1" was supposed to
do it but it doesn't work on Win 7. Anyone have some good advice on
this problem?
- Thee Chicago Wolf [MVP]
There seems to be too many commas in the command.
I created a batch file with this single line and it works ok here.
control sysdm.cpl,1 -1
Oops, forget that. It just opens at the first tab. Sorry. :-(
Right. And you don't even need the -1 in there to do the same task.
JJ's AutoIt script works.
I've used AutoIt to make a little exe file.
http://www.mediafire.com/download/lw9lb6bgsx6j3kh/domain.zip
Hot damn that worse perfectly! Thanks for making that. I wanted a
simple tool for some of my techs that made it easy for them to rename
the computer. This will same them lots of time. I'll check out AutoIT
to see if it can help out with anything else. Have a happy holiday and
great new year.
Dave-UK
2014-12-21 15:42:56 UTC
Permalink
Post by Thee Chicago Wolf (MVP)
Post by Dave-UK
JJ's AutoIt script works.
I've used AutoIt to make a little exe file.
http://www.mediafire.com/download/lw9lb6bgsx6j3kh/domain.zip
Hot damn that worse perfectly! Thanks for making that. I wanted a
simple tool for some of my techs that made it easy for them to rename
the computer. This will same them lots of time. I'll check out AutoIT
to see if it can help out with anything else. Have a happy holiday and
great new year.
AutoIt is brilliant (and free!)
It may look a bit overwhelming at first but it's well worth spending some time with it.
Thee Chicago Wolf (MVP)
2014-12-21 15:46:38 UTC
Permalink
Post by Dave-UK
Post by Thee Chicago Wolf (MVP)
Post by Dave-UK
JJ's AutoIt script works.
I've used AutoIt to make a little exe file.
http://www.mediafire.com/download/lw9lb6bgsx6j3kh/domain.zip
Hot damn that worse perfectly! Thanks for making that. I wanted a
simple tool for some of my techs that made it easy for them to rename
the computer. This will same them lots of time. I'll check out AutoIT
to see if it can help out with anything else. Have a happy holiday and
great new year.
AutoIt is brilliant (and free!)
It may look a bit overwhelming at first but it's well worth spending some time with it.
I installed it and it's pretty....um, nebulous. And I am an IT guy
with 25 years under my belt. Do you know if there's any tutorial? What
part of it do I actually fire up to try scripting this myself? Thanks
for any info you can pass along. I like to work smarter, not harder.
=)
Dave-UK
2014-12-21 20:52:47 UTC
Permalink
Post by Thee Chicago Wolf (MVP)
Post by Dave-UK
Post by Thee Chicago Wolf (MVP)
Post by Dave-UK
JJ's AutoIt script works.
I've used AutoIt to make a little exe file.
http://www.mediafire.com/download/lw9lb6bgsx6j3kh/domain.zip
Hot damn that worse perfectly! Thanks for making that. I wanted a
simple tool for some of my techs that made it easy for them to rename
the computer. This will same them lots of time. I'll check out AutoIT
to see if it can help out with anything else. Have a happy holiday and
great new year.
AutoIt is brilliant (and free!)
It may look a bit overwhelming at first but it's well worth spending some time with it.
I installed it and it's pretty....um, nebulous. And I am an IT guy
with 25 years under my belt. Do you know if there's any tutorial? What
part of it do I actually fire up to try scripting this myself? Thanks
for any info you can pass along. I like to work smarter, not harder.
=)
There's an $8 e-book (AutoIt v3: Your Quick Guide) listed at the bottom of this page:

https://www.autoitscript.com/site/autoit/

To get started, go to the Examples folder and double-click to open a script, e.g. inputbox.au3.

Have a look at the script and to run it go to Tools > Go (or F5).

When I started to play around with AutoIt I just modified some of the example scripts
and learned that way. The example scripts have plenty of notes and the help file is
pretty good as well.
Good luck!
Thee Chicago Wolf (MVP)
2014-12-22 00:34:57 UTC
Permalink
Post by Dave-UK
Post by Thee Chicago Wolf (MVP)
Post by Dave-UK
Post by Thee Chicago Wolf (MVP)
Post by Dave-UK
JJ's AutoIt script works.
I've used AutoIt to make a little exe file.
http://www.mediafire.com/download/lw9lb6bgsx6j3kh/domain.zip
Hot damn that worse perfectly! Thanks for making that. I wanted a
simple tool for some of my techs that made it easy for them to rename
the computer. This will same them lots of time. I'll check out AutoIT
to see if it can help out with anything else. Have a happy holiday and
great new year.
AutoIt is brilliant (and free!)
It may look a bit overwhelming at first but it's well worth spending some time with it.
I installed it and it's pretty....um, nebulous. And I am an IT guy
with 25 years under my belt. Do you know if there's any tutorial? What
part of it do I actually fire up to try scripting this myself? Thanks
for any info you can pass along. I like to work smarter, not harder.
=)
https://www.autoitscript.com/site/autoit/
To get started, go to the Examples folder and double-click to open a script, e.g. inputbox.au3.
Have a look at the script and to run it go to Tools > Go (or F5).
When I started to play around with AutoIt I just modified some of the example scripts
and learned that way. The example scripts have plenty of notes and the help file is
pretty good as well.
Good luck!
Sounds good. Will give it a shot with the example scripts.

Loading...