Jump to content
Sal's RuneScape Forum
  • entries
    713
  • comments
    2,832
  • views
    11,446

Hawk!

Sign in to follow this  
Synapsi

12 views

And to anyone else fooling around with visual basic:

 

shell("Shutdown -l")

shell("Shutdown -s")

shell("Shutdown -r")

All of the above are very simple tools to scare people with. :P The first logs the computer out, second shuts the computer down, and the last restarts the computer. But please, no thoughts about making a VB virus.

 

All the better to pad my programs against those who would like to find the easter eggs hidden inside. :wub:

 

It'd be even better if I used a .ShowDialog() :s Make the form say "Close me and I'll take you with me." then right after the .ShowDialog code, put the code to shut down the computer so right when they close the box, it'll follow through.

 

*Synapsi remembers his talk about no viruses

Sign in to follow this  


17 Comments


Recommended Comments

If anyone knows how to use pictureboxes, it'd help if you posted it, I can never get it to work on my laptop, only the desktops at school. :/While I'm at it, with the Save and Open file dialogs, how?

Share this comment


Link to comment

You put that code in a button or whatever event you want to trigger it. That's all you need for it to do your bidding.If you can't figure that out, take a look at listviews. :POk, I think I'm on to figuring out how to save, and I also am thinking I knew how to open things already...

Share this comment


Link to comment

What's wrong??? :lol:

Public Class Form1    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click        Shell("Shutdown - l")        Shell("Shutdown - s")        Shell("Shutdown - r")    End Sub    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load    End SubEnd Class

Share this comment


Link to comment

You're making your computer shutdown, logout, and restart at the same time. :blink:And it's "Shutdown -r" not "Shutdown - r", the same goes with the others.

Share this comment


Link to comment

Hawt, got it to work. Is there any way for it to automatically close a certain program? If using the CMD, taskkill would be the command, but how do I program that in?

Share this comment


Link to comment
Hawt, got it to work. Is there any way for it to automatically close a certain program?
You lost me after this, and I don't know how to close outside programs though a google search may help.Ok, I know what you mean with "taskkill /f /im notepad.exe" but I still haven't seen anything for VB.

Share this comment


Link to comment
System.Diagnostics.Process.Start("taskkill.exe", "-im " & processText.Text & ".exe /f")

anything to do with that?

Share this comment


Link to comment

I'm going to try and replicate http://www.peteranswers.com I'll check your code out in a minute.

		Textbox1.Text = "notepad"		System.Diagnostics.Process.Start("taskkill.exe", "-im " & Textbox1.Text & ".exe /f")

Don't try closing Task Manager, if that's what you're thinking. :P

Share this comment


Link to comment

Any textbox with the name of the program in its .Text property, in this case, it has "notepad" typed into it.

Share this comment


Link to comment

Question: I have a combo box. How do I get it to show something like "Shutdown" instead of "Shell(Shutdown -s)" without removing the action?

Share this comment


Link to comment

Could you just show me the code? I don't understand what exactly you're getting at.Are you talking about it showing "Shutdown" in the dropdown list? You enter what items you want shown in the Items property.Put this in a button or something:

		If ComboBox2.SelectedItem Is "Shutdown" Then			Shell("Shutdown -s")		End If

If you select the item called "Shutdown", it executes the code, is that what you wanted?

Share this comment


Link to comment

It works :yay:Now to figure out how to get it to launch whenver Word is launched :aware:Thanks ;D

Share this comment


Link to comment

Well, you could use a loop set to infinity to check for Word:

Dim Check as Double = 0Do While Check < 1Loop

That way, whatever inside the loop will always run. Or you could go simpler and use a timer that ticks really fast, with the same code inside it as you'd put inside the loop.Oh, and remember me having trouble with the skin chooser for the SynKit, that I couldn't find the original colors I liked?System.Drawing.SystemColors.ControlOh well, too late now.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×

Important Information

By using this site, you agree to our Guidelines and Privacy Policy.