Advertisement

[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

04/22/2008 at 07:52AM PDT, ID: 23343157
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Shutdown Remote LAN PC Using ASP with IIS 5.1

Asked by MrPrince in Active Server Pages (ASP)

Tags: ASP, IE6+

What Im trying to do:

Im building a website that will let office users start-up and shutdown computer interactives in a temporary exhibition.

What Im using to do it:

Im using a standard XP Pro workstation running IIS 5.1 to serve my site. The interactives are in a dedicated vlan, along with the IIS server.

Where Ive got to:

Im using three core components to achieve my goal: 1 ASP, 2. Depicus Wake-On-Lan and 3. Psshutdown from Sysinternals.
Currently my code runs two different batch files on the IIS server which ,depending on what the user wants to do, either run Wake-on-lan or shut the PCs down. My ASP is this: See Snippet

My two batch files are:

Wake on lan:
c:\wolcmd.exe 00132102B217 192.168.1.209 255.255.255.0 8900

Shutdown:
C:\psshutdown.exe \\192.168.1.209 -u Administrator -p ******** -t 0

IIS 5.1 is using anonymous access (Integrated Windows authentication also ticked) with a Domain User name & password which has full permissions set against the files actually shutting down and starting up my machine.

My asp code is successfully booting up my PC but it not shutting it down. Since the code running the batch file on server is the same, i.e. only the script location is changing, Im assuming the problem isnt the asp&

My problem:

Im stuck being unable to see the wood for the trees, I need my site to successfully shut down the interactives& any ideas? Thanks for looking.


View the Solution FREE for 30 Days
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
<%
              const SUCCESS = 0
              const ERROR = 1
              const WARNING = 2
              const INFORMATION = 4
              const AUDIT_SUCCESS = 8
              const AUDIT_FAILURE = 16
              dim wshshell, strSwitch, strCommand
              strSwitch = request.form("switch").Item 
              if strSwitch = "startup" then
			    set wshshell = Server.CreateObject("WScript.Shell")
                strCommand = "%comspec% /c c:\OpenTest.bat"
				wshshell.run strCommand
                wshshell.Logevent SUCCESS, "Exhibition startup button pressed."
                set wshshell = nothing
				set strSwitch = nothing
				set strCommand = nothing
				response.Write("<p><table><tr><td><img src='images/tick.gif'></td><td width='5'></td><td><strong>Option 1, Startup, was selected and the interactives have been signalled to turn on.</strong><br>Click <a href='#' onClick='history.go(-1)'>here</a> to go back to the homepage.</td></tr></table></p>")
              elseif strSwitch = "shutdown" then
			  	set wshshell = Server.CreateObject("WScript.Shell")
                strCommand = "%comspec% /c c:\CloseTest2.bat"
				wshshell.run (strCommand)
                wshshell.Logevent SUCCESS, "Exhibition shutdown button pressed."
                set wshshell = nothing
				set strSwitch = nothing
				set strCommand = nothing
	            response.Write("<p><table><tr><td><img src='images/tick.gif'></td><td width='5'></td><td><strong>Option 2, Shutdown, was selected and the interactives have been signalled to turn off.</strong><br>Click <a href='#' onClick='history.go(-1)'>here</a> to go back to the homepage.</td></tr></table></p>")
              elseif strSwitch = "" or null then
			    response.Write("<p><table><tr><td><img src='images/cross.gif'></td><td width='5'></td><td><strong>A problem has occured. No sinals have been sent.</strong><br>Please click <a href='#' onClick='history.go(-1)'>here</a> to go back to the homepage and try again.</td></tr></table></p>")
			  end if
            %>
[+][-]04/23/08 12:52 PM, ID: 21424646

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/23/08 04:09 PM, ID: 21426398

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/23/08 04:11 PM, ID: 21426408

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: ASP, IE6+
Sign Up Now!
Solution Provided By: CyrexCore2k
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20090624-EE-VQP-63 / EE_QW_2_20070628