Archive for August, 2011

VBS Script to enable or disable remote desktop on a remote system

For those times when you need to remote into a system and remote desktop is disabled, the below script can come in very handy.

 

' This script will enable or disable remote desktop on a remote system

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = InputBox("Enter the COMPUTER NAME of the system you would like to enable or disable Remote Desktop: leave as localhost for this computer","Enable or Disable Remote Desktop","Localhost")

If strComputer = "" Then
WScript.Quit
End If

Set StdOut = WScript.StdOut

On Error Resume Next

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" &_
strComputer & "rootdefault:StdRegProv")
If Err.Number <> 0 Then
WScript.Echo "An error has occurred. You may have mistyped the computer name."
WScript.Quit
End If

strKeyPath = "SYSTEMCurrentControlSetControlTerminal Server"
strValueName = "fDenyTSConnections"

oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

If dwValue = 1 Then
prompt = MsgBox ("Remote Desktop is Currently disabled. Do you want to ENABLE it?", vbYesNo)
If prompt = vbYes then
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
WScript.Echo "Remote Desktop is now ENABLED on " & strComputer
WScript.Quit
ElseIf prompt = vbNo then
WScript.Echo "Remote Desktop is still DISABLED."
Wscript.Quit
End If
ElseIf dwValue = 0 then
prompt = MsgBox ("Remote Desktop is Currently ENABLED. Do you want to DISABLE it?", vbYesNo)
If prompt = vbYes then
dwValue = 1
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
WScript.Echo "Remote Desktop is now DISABLED on " & strComputer
WScript.Quit
ElseIf prompt = vbNo then
WScript.Echo "Remote Desktop is still ENABLED."
WScript.Quit
End If
End If


2011/08/30 | By | Reply More

Using WinRAR SFX to Create a Silent Install Package

WinRAR is a great compression, and though there are many good free compression applications available, its SFX (Self-Extracting Install) feature make it well worth the $29 USD price tag.

I use it almost daily to create silent install of applications that I need to push out to users on the network

In this guide I will show how to create a simple silent install of the popular FTP program called Filezilla

After you have WinRAR installed right click the filezilla installer package and select WinRAR> Add Archive

8-26-2011 9-54-25 PM

In the General pane select Create SFX archive

8-26-2011 10-00-19 PM

WinRAR will automatically crate a sfx exe version. Now right click that and select WinRAR > open with WinRAR

8-26-2011 10-01-54 PM

WinRAR opens with the filezilla setup program inside of it.  Select the SFX icon and then select advanced SFX options.

8-26-2011 10-03-15 PM

In the General Tab we will define the silent switch variable that runs filezilla silently . In this case it is /S so under Run after extraction we type the full filename and the /S switch.

8-26-2011 10-04-58 PM

Under modes we make sure it unpacks to a temporary folder and Hides all displays.

8-26-2011 10-05-40 PM

Under Update we will select the extract and replace files and the overwrite all files (This is done just in case an earlier version may have been copied at some point)

8-26-2011 10-06-00 PM

Finally if we want to customize the icon that the package will use we can add it here.

8-26-2011 10-07-51 PM

Select OK

8-26-2011 10-26-24 PM

The new filezilla silent install package with its customize icon are now  ready for use.

8-26-2011 10-09-01 PM

2011/08/27 | By | 9 Replies More

Make Your Own Offline Installers Using WinRar

In a day and age where upwards of 2 trillion people access the Internet everyday to shop online, check email, play games or work, many software distributors have taken an Internet connection for every computer as a foregone conclusion. As such, publishers are now using online installers for their applications rather than distributing their software on CDs or DVDs. These small executables and installers are nothing but downloaders which connect to the Internet in order to load the actual installation files. But what about that small fraction of people who still have computers without high-speed Internet connections? Even if you save the installer to a flash drive, CD or a floppy disk, you’re still left high and dry once it attempts to connect to the Internet or download a 600 MB installation file over a 56 Kbps dial-up modem.

If this sounds like you, fear not. Today we’ll show you how to create your own offline installers for almost any program using WinRar. Plus, we’ll provide you with some instantly downloadable offline installers for some of the most used apps on the web.

You will need:

  • WinRar – Download Here
  • The program for which you want to create an offline installer already installed on another computer
  • Basic knowledge of 32- and 64-bit architecture regarding Windows Program Files

Locating the Program Files for Your Application

Step 1

To begin, run WinRar as an administrator. To do this, Right-click its shortcut icon (or executable file) and choose Run as administrator. (Skip this if you’re running XP).

Step 2

From within WinRAR, navigate to the directory where the program you want to create an offline installer for is located.

The installation directory for your application will vary depending on whether it’s a 32-bit or 64-bit app. If you’re not sure if you are running a 32-bit version or 64-bit version of Windows, Click Start and Right-click Computer and choose Properties. It’ll be listed next to “System Type.”

For 32-bit Windows operating systems your programs will be in C:Program Files

For 64-bit Windows operating systems, your programs will likely be in C:Program Files (x86). Note, however, that 64-bit Windows systems can run both 32-bit and 64-bit apps, so if it’s not in C:Program Files (x86) check in C:Program Files.

From this folder, look for the name of the application or the name of the publisher. For example, if you’re looking for Photoshop, it’ll be in the Adobe folder, i.e. C:Program FilesAdobeAdobe Photoshop CS5. Some applications aren’t located in sub folders, i.e. C:Program Files (x86)Opera

Step 3

Click the folder that contains the application to select it.

Step 4

Right-click the folder and choose Add files to archive.

Configuring Your Offline Installer

Step 1

The Archive name and parameters window will open. Click the General tab. Check the box next to Create SFX archive.

Step 2

Click the Advanced tab and Click SFX options…

Step 3

In the General tab of the Advanced SFX Options… window, Type the folder path where you’d like the program to install into the Path to extract field. You can choose whichever path you’d like, but the most logical place is in Program Files. You can type it in manually—for 32-bit programs this will be C:Program Files or C:Program Files[developer name]. For 64-bit programs, this will be  C:Program Files (x86) or C:Program Files (x86)[developer name]—or you can Select Create in “Program Files” or type %programfiles% in the field. This will automatically detect the Program Files folder on the target machine. Note: It’s not necessary to add the application name, since you’ll be including the entire folder in the archive.

Also, make sure you Check Save and restore paths.

Step 4

If you’d like to add installation instructions, notes or a custom icon, you can do so in the Text and icon tab. This text will appear when the user runs the offline installer.

Step 5

Click OK to close the Advanced SFX Options windows. Click OK again in the Archive name and parameters window to create the archive.

Testing Your Offline Installer

Once the archiving is complete, your offline installer will appear in the target location. If you didn’t choose one, it’ll be in the same folder as the source folder.

Always test your offline installer before distributing them to your friends, family, co-workers and clients! Find yourself a computer where the application you archived is not installed and test out your installer there. In my test, I found that Skype works just fine with my offline installer and I can freely carry it around on my USB thumb drive just in case.

Conclusion

As you might’ve gathered, this isn’t a perfect solution. Essentially, you’re just making a self-extracting archive that saves the end user from the work of unzipping the file and choosing a directory. There are some pros and cons to this method:

Pros:

  • Quick and easy for you and the end user.
  • Packages all the necessary program files in a single archive for easy copying onto a thumb drive or CD.
  • Install file is its own executable—no need to install WinRAR or any other software on the target computer.

Cons:

  • This method may not work for all applications since some applications require additional integration into Windows (i.e. access to system files, altering of Windows registry keys).
  • Doesn’t automatically create a shortcut on the desktop or in the Start Menu.
  • The program can’t be uninstalled using the Add/Remove Programs dialog. To remove it, you must delete it directly from the Program Files folder.
2011/08/27 | By | Reply More