Showing posts with label VB Script. Show all posts
Showing posts with label VB Script. Show all posts

Shortcut to Show/Hide Hidden Files

Geek Tutor , ,












This tutorial will teach how to create a shortcut to show or hide hidden files on your computer. It's a simple visual basic script that will take effect immediatly after double-clicking on it. It's a fast way to show or hide your hidden files instead of navigating to control panel > folder options and choose to show or hide the files.

1- Open Notepad
2- Copy and paste the following code into notepad

Set sh = CreateObject("WScript.Shell")
theKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
setHidden = sh.RegRead(theKey)
If setHidden = 1 Then
setHidden = 0
MsgBox "System and hidden files will no longer appear in Explorer.",64,"Hidden File Exchange"
Else
setHidden = 1
MsgBox "System and hidden files will appear in Explorer.",64,"Hidden File Exchange"
End If
sh.RegWrite theKey,setHidden,"REG_DWORD"
Set sh = Nothing

3- Save it as anything.vbs (you can name it any name you choose as long as you don't include spaces and the extension must be .vbs (In the Save as type panel choose All Files, this is a very important step so the script is saved as vbs)
4- This works only on Vista/Seven when User Account Control (UAC) is disabled because it needs access to the registry.

How To Use It
Just double-click on the script, if you are showing your hidden files they will become hidden and vice versa. You should notice the change without restarting windows all you have to do if you noticed a delay is pressing F5 on your keyboard to refresh.

Download a ready-to-use hiddenfiles.vbs by clicking Here
Read more ...

How To Find Your Computer's Boot Time

Geek Tutor ,












Ever wanted to know how much time does your computer take to boot? Is it slow or fast? This tutorial will help answer your question not just in the purpose of just knowing, you can benefit a lot from knowing your computer's boot time how? You can test how much time it takes to boot before and after installing an application such as an antivirus or any other app.

1- Open Notepad
2- Copy & paste the following code into notepad

Option Explicit
On Error Resume Next
Dim Wsh, Time1, Time2, Result, PathFile, MsgResult, MsgA, AppName, KeyA, KeyB, TimeDiff
MsgA = "Please close all running applications and click on OK."
KeyA = "HKEY_CURRENT_USER\Software\RestartTime\"
KeyB = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\RestartTime"
AppName = "Reboot Time Test"
Set Wsh = CreateObject("WScript.Shell")
PathFile = """" & WScript.ScriptFullName & """"
Result = wsh.RegRead(KeyA & "Times")
if Result = "" then
MsgResult = Msgbox (MsgA, vbOKCancel, AppName)
If MsgResult = vbcancel then WScript.Quit
Wsh.RegWrite KeyA & "Times", left(Time,8 ), "REG_SZ"
Wsh.RegWrite KeyB, PathFile, "REG_SZ"
Wsh.Run "cmd /c Shutdown -r -t 00", false, 0
else
Wsh.RegDelete KeyA & "Times"
Wsh.RegDelete KeyA
Wsh.RegDelete KeyB
TimeDiff = DateDiff("s",Result,left(Time,8 ))
MsgBox "Your computer reboots in " & TimeDiff & " seconds", VbInformation, AppName
end if
wscript.Quit

3- Save it as anything.vbs (make sure you choose .vbs as extension for your file & don't include spaces if you choose a multiple words name for example if you choose to name it " boot time test ", you should enter boottimetest.vbs NOT boot time test.vbs)
4- In the Save as type choose All Files (Very Important !!)
5- Double-click on the file, you will be asked to save and close all your work because your computer is about to restart. Click Ok to restart
6- When windows starts again a message with the number of seconds your computer took to boot will be displayed on your desktop.

To download a ready-to-use boottimetest.vbs click Here
Read more ...
 
Copyright 2010 Geek Tutor