X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => MyHouse Online => Topic started by: HouseMaster on January 18, 2006, 08:55:38 AM

Title: Dial Up/Windows Commands Answers Here
Post by: HouseMaster on January 18, 2006, 08:55:38 AM
I have figured out how to run Windows
commands from within MyHouse.

Some basic commands can be run by accessing
the command in the Windows System 32
folder, however if you wish to add
parameters to the command there is a
special trick....

1: Create a notepad file with the command
(including parameters) that you wish to run
e.g. rasdial /d

2: Save the file with the extension .cmd
e.g. disconnect.cmd

3: Drag the Windows command dialogue from
Smart Macros Advanced functions tab into
your macro.

4: Click the browse button on the Windows
command dialogue and point to your command
notpad file e.g. disconnect.cmd

5: When you run the Macro it should work!

Note: that there issues with MyHouse not
disconnecting when using Dial Up.  You can
use the following to force disconnection:

1: Create the disconnect.cmd file as above
(rasdial /d)
2: Add the following to a 'disconnect'
Smart Macro:
a) Network Server Control: (STOP)
b) Windows Command: disconnect.cmd

Note that step a) is essential to prevent
MyHouse from continually trying to re-
connect and log onto the internet even
after Rasdial disconnect.

Ant
Title: Re: Dial Up/Windows Commands Answers Here
Post by: X10 Pro on January 18, 2006, 01:15:57 PM
Nice tip. This is necessary since we don't
pass parameters to the programs called in the
Windows command macro element. You should be
able to just run a batch file as well.
Title: Re: Dial Up/Windows Commands Answers Here
Post by: Ant on January 18, 2006, 02:11:24 PM
X10Pro,

FYI: I tried putting the commands in a .bat
batch file, but that did not work.

Ant
Title: Re: Dial Up/Windows Commands Answers Here
Post by: X10 Pro on January 19, 2006, 08:01:03 PM
Just FYI, we've added the macro commands to
start and stop the dial-up connection in our
code, and have fixed the bug with the
connection not hanging up as specified. We've
got a couple other things to finish, and then
we'll be releasing an update.
Title: Re: Dial Up/Windows Commands Answers Here
Post by: harold on January 25, 2006, 07:40:02 PM
I tried to ask the tech support people last
week about how to pass parameters to a
Windows command.  They were not even aware
that you could run Windows commands!  Do you
plan to add that capability in the NEXT
release?  I am using .BAT files at the
moment, but they are VERY unreliable.

How many MACROS can run simultaneously?  If
a macro is triggered five times in a row,
are the second four ignored, queued to run
sequentially, or do they all run
concurrently?

Thanks!
Title: Re: Dial Up/Windows Commands Answers Here
Post by: Ant on January 26, 2006, 11:40:05 AM
Harold,

Use a .cmd file instead of a batch file.
Use notepad to create the command and save
with a .cmd extension.  Works for me
everytime.

Ant
Title: Re: Dial Up/Windows Commands Answers Here
Post by: robby on January 26, 2006, 08:36:29 PM
Attn: HouseMaster and/or Ant
Can you explain to this ignorant person
(me) just what you are explaining here.
What Windows programs or commands would you
run? Where would you save these .cmd files
and how would you exactly write them.
Thanks in advance,
Robby
Title: Re: Dial Up/Windows Commands Answers Here
Post by: Ant on January 27, 2006, 03:05:34 PM
Hi Robby,

Don't forget that when you use MyHouse
remotely you can only control modules and
macros that are defined on the 'host' pc.

If you wish to initiate some other Windows
function on the host PC remotely via
MyHouse then the only way to do this is to
use the Windows command function.

For example, there is a bug in MyHouse
which does not correctly end a dial up
session as defined in the preferences (e.g.
after 20 minutes of connection).  In this
example, I created a windows command file
to manually force a disconnect from the
internet.  The file is created in Notepad
and saved as a .cmd file i.e.
disconnect.cmd.

The file can be stored anywhere on
the 'host PC' i.e. C:\mydocuments

I then created a Macro using the Windows
command button (advanced features).  This
command simply calls or points to the file
disconnect.cmd and then runs it.

Note: in notepad you must obviously define
a valid windows command.  In my example I
used rasdial /d (which disconnects from the
net).

You can type a windows command directly
into the Windows Commands dialogue of the
Macro, but you cannot pass other parameters
to the command.  The advantage of using my
batch file (.cmd)technique is that
parameters can be passed to the windows
command.  In my example using rasdial, the
parameter would be /d (for disconnect).

You can do an internet search to see the
standard Windows commands available.  Just
be careful as you can use commands to turn
off the PC or restart it etc..

Hope this helps.

HouseAnt
Title: Re: Dial Up/Windows Commands Answers Here
Post by: robby on January 28, 2006, 11:51:42 AM
Thanks HouseAnt... I'll play around a
little now that you have given me some
background. I am on broadband so I don't
have the problems you are having.
Robby