Bu vbscript, bilgisayarınızı hazırda bekletmek isteyip istemediğinizi soran Masaüstü'nize bir kısayol oluşturabilir.
Ve tabii ki, yeniden başlatma veya kapatma için bunu değiştirebilirsiniz.
Option Explicit
Dim MyScriptPath
MyScriptPath = WScript.ScriptFullName
Call Shortcut(MyScriptPath,"Hibernate the computer")
Call AskQuestion()
'**********************************************************************************************
Sub Shortcut(PathApplication,Name)
Dim objShell,DesktopPath,objShortCut,MyTab
Set objShell = CreateObject("WScript.Shell")
MyTab = Split(PathApplication,"\")
If Name = "" Then
Name = MyTab(UBound(MyTab))
End if
DesktopPath = objShell.SpecialFolders("Desktop")
Set objShortCut = objShell.CreateShortcut(DesktopPath & "\" & Name & ".lnk")
objShortCut.TargetPath = Dblquote(PathApplication)
ObjShortCut.IconLocation = "%SystemRoot%\system32\SHELL32.dll,-28"
objShortCut.Save
End Sub
'**********************************************************************************************
Sub AskQuestion()
Dim Question,Msg,Title
Title = "Hibernate the computer by Hackoo 2016"
Msg = "Are you sure to Hibernate the computer now ?"& Vbcr &_
"If yes, then click [YES] button "& Vbcr &_
"If not, then click [NO] button"
Question = MsgBox (Msg,VbYesNo+VbQuestion,Title)
If Question = VbYes then
Call Run_Hibernate()
else
WScript.Quit()
End if
End Sub
'**********************************************************************************************
Function DblQuote(Str)
DblQuote = Chr(34) & Str & Chr(34)
End Function
'**********************************************************************************************
Sub Run_Hibernate()
Dim ws,Command,Execution
Set ws = CreateObject("wscript.Shell")
Command = "Cmd /c %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Hibernate"
'Command = "Cmd /c Shutdown -s -t "& N &" -c "& DblQuote("Save your work because your PC will shut down in "& N &" seconds")
Execution = ws.run(Command,0,True)
End sub
'**********************************************************************************************
Google 'windows kapatmayı kapattığımda çok fazla sonuç alıyorum, bunların hiçbiri sizin için çalışmıyor mu? –
all im getting bu türdür: 'C: \ WINDOWS \ system32 \ shutdown.exe -a' ama dediğim gibi, yalnızca kapatma bir zamanlayıcı tarafından yapıldığı zaman çalışıyor, ya da kapatma gibi bir alarm - t 200 Kapatma düğmesini Windows GUI aracılığıyla kapattığımda kapatmayı durdurmak için kullanamıyorum .. –
Sanırım siz yapabilirsiniz - sadece çalışırken hızlı bir şekilde çalıştırabilirsiniz. Durumunuz tam olarak nedir, biraz daha detay ekleyebilir misiniz? Örneğin, yöneticilerin yönetici olmayan kullanıcıların makineyi kapatmasını ve Kayıt Defterini kullanmasını engellemesi mümkündür. Bu bir seçenek değil mi? –