::
Computers & Technology
some visual basic tricks
neda haghighat
Posted: 2015-01-15
If you want to make you friends crazy with your scripts try these:
**If you want to shutdown system, you can use this code:
@echo off
msg * Your system will be shutdown in some seconds!
shutdown -c -s -t 10
**If you want to make the CD drives constantly eject:
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
do
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
End If
wscript.sleep 100
loop
**If you want to open an application until the computer freezes!!
@echo off
:LoopTop
START %SystemRoot%system32*.exe —instead of * name the program you like
GOTO LoopTop
** If you want to continuously turns caps lock on and off:
Set wshShell =wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}" — you can use other key like Enter by this code : "~(enter)" or BackSpace : "{bs}"
loop