SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-12-2006, 09:36 AM
trevorst trevorst is offline
Sage Advanced User
 
Join Date: May 2003
Posts: 181
Can I do this with Studio ???

I would like to have my client shut down the computer when Sage is Closed. I have already added an Exit command on the main menu and would like the machine to shut down when my wife clicks on it.

The machine is used only for PVR use and is set to bring Sage up on boot, if I need to do maintence I can take sage out of FS and exit that way.
Reply With Quote
  #2  
Old 05-12-2006, 09:52 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,614
I don't know a command/utility to use with it, but I would think you could use the ExecuteProcess API call to run a program that shuts down the PC.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #3  
Old 05-12-2006, 10:03 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by Opus4
I don't know a command/utility to use with it, but I would think you could use the ExecuteProcess API call to run a program that shuts down the PC.

- Andy
NirCmd supports shutting down remote computers ...

Dirk
Reply With Quote
  #4  
Old 05-12-2006, 04:55 PM
trevorst trevorst is offline
Sage Advanced User
 
Join Date: May 2003
Posts: 181
Downloaded nircmd and it looks like it will work (running from command line) now how do I use it in studio. Tried making a new action widget that used executeprocess but it does nothing.
Executeprocess(c:\nircmd.exe, exitwin poweroff,,)

Any thoughts ???
Reply With Quote
  #5  
Old 05-12-2006, 05:01 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,614
Quote:
Originally Posted by trevorst
Executeprocess(c:\nircmd.exe, exitwin poweroff,,)
You'll have to put quotes around the command string. Then, for more info about sending multiple arguments to the program, see executeprocess arguments.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #6  
Old 05-12-2006, 05:29 PM
trevorst trevorst is offline
Sage Advanced User
 
Join Date: May 2003
Posts: 181
That still didn't work, here is the command line.
ExecuteProcess(C:\nircmd.exe, "exitwin poweroff", , )

Appreciate any help...
Reply With Quote
  #7  
Old 05-12-2006, 05:33 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by trevorst
That still didn't work, here is the command line.
ExecuteProcess(C:\nircmd.exe, "exitwin poweroff", , )

Appreciate any help...
args = java_lang_String_split("exitwin,poweroff",",")
ExecuteProcess("C:\\nircmd.exe", args, null, null)

That should do it ...


Dirk
Reply With Quote
  #8  
Old 05-12-2006, 05:53 PM
trevorst trevorst is offline
Sage Advanced User
 
Join Date: May 2003
Posts: 181
Thanks I'll give that a try tomorrow.. Args should still be in quotes "exitwin poweroff" correct ???
So the full string should be ExecuteProcess("C:\\nircmd.exe", "exitwin poweroff", null, null)

Is this correct ???

Last edited by trevorst; 05-12-2006 at 05:55 PM.
Reply With Quote
  #9  
Old 05-12-2006, 06:42 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by trevorst
Thanks I'll give that a try tomorrow.. Args should still be in quotes "exitwin poweroff" correct ???
So the full string should be ExecuteProcess("C:\\nircmd.exe", "exitwin poweroff", null, null)

Is this correct ???
No, actually it should be exactly as I posted it above. If you dont want to create two action widgets, you can also write

Code:
ExecuteProcess("C:\\nircmd.exe", java_lang_String_split("exitwin,poweroff",","), null, null)
You need the java call (which simply creates a String array from the comma separated string) because ExecuteProcess expects a Collection or Array for the args parameter, otherwise it would be interpreted as a single argument ...

Hope this helps,

Dirk
Reply With Quote
  #10  
Old 05-12-2006, 09:11 PM
trevorst trevorst is offline
Sage Advanced User
 
Join Date: May 2003
Posts: 181
Thanks for all the replies but I am getting confused...
Could someone please paste the code I should use, that would be a great help. I think you guy's are great to help but a little actual code is such a great help....
Thanks for all your inputs.
Reply With Quote
  #11  
Old 05-12-2006, 09:15 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,614
Quote:
Originally Posted by trevorst
Could someone please paste the code I should use
That's exactly what flachbar has done, twice. Can you be more clear as to what you don't understand about it? He has provided the exact text to use on one (2nd post) or two (1st post) Action widgets.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #12  
Old 05-13-2006, 03:02 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
You might want to turn on the Notify on Errors checkbox in Studio so you can tell if you've entered the expressions incorrectly.
__________________
-- Greg
Reply With Quote
  #13  
Old 05-13-2006, 08:32 AM
trevorst trevorst is offline
Sage Advanced User
 
Join Date: May 2003
Posts: 181
Thanks Dirk your code worked like a charm and helped me understand the syntax a lot better....
Opus my last post crossed with the post from Dirk so I didn't see the code last night.

This has really upped the WAF for me.. Thanks for all the help.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.