Advertisement

01.04.2007 at 07:38AM PST, ID: 22110883
[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!

9.0

Reboot using vbs - follow up question: How to log in automatically

Asked by WileyPowers in Visual Basic Programming

Dear all,

The below solution for reboot using VBS was provided by jkaios. However, this I would like to amend so that after the reboot the script will log me in automatically (using the log-in name and password that is currently in use on this specific pc). Let's assume that my username is: User, and that my password is: User1

The original script by jkaios is the following:

Option Explicit

If MsgBox("Do you want to reboot now?", vbInformation + vbYesNo, "Reboot") = vbYes Then
   If Not RebootMyMachine Then
      MsgBox "An error occurred while attempting to reboot."
   End If
End If


Function RebootMyMachine()

   Dim oServices
   Dim objEnum
   Dim objInstance
   Dim sQuery
   
   'Shutdown Method Constants
   Const CONST_LOGOFF = 0
   Const CONST_SHUTDOWN = 1
   Const CONST_REBOOT = 2
   Const CONST_FORCE_LOGOFF = 4
   Const CONST_FORCE_SHUTDOWN = 5
   Const CONST_FORCE_REBOOT = 6
   Const CONST_POWEROFF = 8
   Const CONST_FORCE_POWEROFF = 12
   
   sQuery = "SELECT * FROM Win32_OperatingSystem"
   
   Set oServices = GetObject("winmgmts:{impersonationLevel=impersonate,(shutdown)}!\\.\root\cimv2")
   Set objEnum = oServices.ExecQuery(sQuery)

   If Err Then
      MsgBox "Error 0x" & Hex(Err.Number) & " - " & Err.Description
      Exit Function
   End If
   
   For Each objInstance In objEnum
      With objInstance
         If .Win32ShutDown(CONST_REBOOT) = 0 Then
            RebootMyMachine = True
         End If
      End With
   Next
   
End Function

Is this possible to work out?

Regards,
Wiley

Start Free Trial
[+][-]01.04.2007 at 04:06PM PST, ID: 18248168

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.05.2007 at 03:09AM PST, ID: 18250354

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.07.2007 at 06:02PM PST, ID: 18264143

View this solution now by starting your 7-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: Visual Basic Programming
Sign Up Now!
Solution Provided By: jkaios
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.08.2007 at 03:17AM PST, ID: 18265932

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.08.2007 at 12:45PM PST, ID: 18270277

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32