Categories
cmd scripting shortcut Win 7 Win7 Windows Windows 7 Windows Vista Windows7 wscript

Create Windows Shortcuts With a Script at the Command Line

If you are like me you 1) access numerous Windows computers, in my case mainly servers through Remote Desktop; and 2) like to have your Windows desktop setup a certain way.  Here are some examples of a quick and easy way to create shortcuts with a script.  These examples are Visual Basic Scripts (.vbs) and use Windows Script Host to execute.  Create any or all of the examples and execute it from either the command prompt or Start / Run using:

wscript xyz.vbs

Note: These scripts were all tested on Windows 7, Windows 2008 and 2003.  They should run fine on earlier versions of Windows (XP, Vista, 2000, etc.) as well.

Although most of these examples will create shortcuts to Windows Explorer (the last one is a shortcut to the Command Prompt), they are being placed in different locations.  Of course you could modify the examples to launch any program of your choosing.  Additionally you could combine them into one script that could be launched the first time you logon.

For easy reference I highlighted the values you may want to change to tailor the script to your needs.

Windows 7, Vista and Windows 2008 Server note: You will probably have to execute these with administrative rights.  One way to do this is to launch a command prompt (the old fashioned way – Start [All] Programs / Accessories / Command Prompt) using right-click and selecting “Run As Administrator.”

Example 1 – Shortcut to Windows Explorer in the “All Users” Desktop folder.  I named the script Explorer_Shortcut_on_AU_Desktop.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strDesktop = WshShell.SpecialFolders("AllUsersDesktop" )
set oShellLink = WshShell.CreateShortcut(strDesktop & "Windows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 2 – Shortcut to Windows Explorer in the “All Users” Start Menu folder.  I named the script Explorer_Shortcut_in_AU_Startmenu.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartMenu = WshShell.SpecialFolders("AllUsersStartmenu" )
set oShellLink = WshShell.CreateShortcut(strStartMenu & "Windows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 3 – Shortcut to Windows Explorer in the “All Users” Startup folder.  I named the script Explorer_Shortcut_in_AU_Startup.vbs.  This will cause one instance of Windows Explorer to launch during logon.  If you’re like me you will be using it anyway, so why not have it open automatically.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AllUsersStartmenu" )
set oShellLink = WshShell.CreateShortcut(strStartup & "programsstartupWindows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 4 – Shortcut to Windows Explorer in the “Current User” Quick Launch toolbar.  I named the script Explorer_Shortcut_in_CU_QuickLaunch.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AppData" )
set oShellLink = WshShell.CreateShortcut(strStartup & "MicrosoftInternet ExplorerQuick LaunchWindows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 5 – Shortcut to Command Prompt in the Quick Launch toolbar for you, the current user.  I named the script CMD_Shortcut_in_CU_QuickLaunch.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AppData" )
set oShellLink = WshShell.CreateShortcut(strStartup & "MicrosoftInternet ExplorerQuick LaunchCommand Prompt.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%system32cmd.exe"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "Ctrl+Alt+C"
oShellLink.IconLocation = "%SystemRoot%system32cmd.exe"
oShellLink.Description = "Windows Command Prompt"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

See also:

Categories
HyperTerminal Linux PuTTY SSH Telnet TeraTerm Win 7 Win7 Windows Windows 7 Windows Vista Windows7

Alternatives to HyperTerminal in Windows 7 and Vista

Beginning with Windows Vista Microsoft removed HyperTerminal (aka HyperTerm & Hyper Terminal).  Of course, this means it isn’t in Windows 7 either. There are several options you can use to replace its functionality.

  • PuTTYMy Recommendation
    • PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along with an xterm terminal emulator.
  • WinRS (Windows Remote Shell)
    • If you only need remote shell access, you can use WinRS which was introduced in Windows Vista. To get help and see execution options with WinRS, run winrs /? at a command prompt.
  • Telnet is a simple, text-based program that you can use to connect to other devices over your local network or over the Internet.  Telnet can be executed right from the command prompt, although you may have to enable it in Control Panel.
  • Phone and Modem Options can be used to troubleshoot modem problems
    • Open Phone and Modem Options by clicking the Start button, Control Panel, Hardware and Sound, finally Phone and Modem Options.
  • Realterm is a terminal program specially designed for capturing, controlling and debugging binary and other difficult data streams. It is far better for debugging comms than Hyperterminal. It has no support for dialing modems, etc – that is what hyperterminal does.
  • TeraTerm is another alternative to HyperTerminal.  Tera Term is a free software terminal emulator (communication program) which supports:
    • Serial port connections.
    • TCP/IP (telnet, SSH1, SSH2) connections.
    • IPv6 communication.
    • VT100 emulation and selected VT200/300 emulation.
    • TEK4010 emulation.
    • File transfer protocols (Kermit, XMODEM, ZMODEM, B-PLUS and Quick-VAN).
    • Scripts using the “Tera Term Language”.
    • Japanese, English, Russian and Korean character sets.
    • UTF-8 character encoding.

  • AbsoluteTelnet Telnet, SSH, and SFTP Client.  AbsoluteTelnet / SSH is a secure flexible terminal client that is suitable for developers, administrators, or deployment across the enterprise. It includes the industry standard SSH protocols to secure terminal session data across insecure environments such as the internet. Its new tabbed interface is a favorite among AbsoluteTelnet users.
  • XP’s Hyper Terminal
    • If you really want (or just can’t be without it) you can still use XP’s Hyper Terminal. Just copy the following two files from an existing XP, Windows 2000 or 2003 box or extract them from the installation CD’s of the previous OS’s: hypertrm.dll and hypertrm.exe. Although you could put them anywhere on the disk as installation is not required, you may want to place them in %SYSTEMROOT% (normally C:WindowsSystem32).
Categories
Linux RichCopy Robocopy Win 7 Win7 Windows Windows 7 Windows Vista Windows7

RichCopy – RoboCopy GUI (sort of) by Microsoft

RichCopy is a free utility from Ken Tamaru of Microsoft. The tool was first developed in 2001 and has been updated regularly to keep pace with evolving needs.  Worthy of note is that RichCopy is a multithreaded copying tool. That means that rather than copying one file at a time in serial order, RichCopy can open multiple threads simultaneously, allowing many files to be copied in parallel and cutting the total time required to complete the operation several times over. You can also pause and resume file copy operations, so if you lose network connectivity at any point, you can just pick up where you left off.

Of course, these are really just the simplest features of RichCopy. As the figure below shows, you also get a vast array of granular controls that allow you to customize all of those fancy aspects of your file copying —filtering files, saving attributes, adjusting cache size, and so on. If you regularly copy lots of files over the network or between various storage devices, these features will significantly ease your daily life.

Download RichCopy.

For those of you like me who prefer the command line see the following about RoboCopy:

Categories
Linux Win 7 Win7 Windows 7 Windows Vista Windows7

Ultimate Windows Tweaker v 2.0 for Windows 7 and Vista

Ultimate Windows Tweaker v 2.0 is a freeware Tweak UI Utility for tweaking and optimizing Windows 7 & Windows Vista, 32-bit & 64-bit. It can simply be downloaded and used as a portable application to customize your Windows to meet your requirements. With judicious tweaking, it can make your system faster, more stable, and more secure with just a few mouse clicks. The tweaker detects whether you have Windows 7 or Windows Vista installed and accordingly offers you only the relevant tweaks.

The tweaker is a 345KB .exe file which does not require an install, yet packs over 150 tweaks & settings. Simply download the zip file, extract its contents and run Ultimate Windows Tweaker. Please don’t detach Empty Icon from executable’s root, the Empty Icon is copied to system directory and referred in runtime. The tweaker has been designed by Ramesh Kumar for The Windows Club.

Download Ultimate Windows Tweaker.  More information.


Categories
Command Line Linux UAC Win 7 Win7 Windows Windows 7 Windows Vista Windows7

Disable/Enable User Access Control (UAC) on Windows 7 or Vista from the Command Line

Microsoft introduced User Account Control (UAC) in Windows Vista. UAC enables users to perform common tasks as non-administrators, called standard users in Windows (Vista and Windows 7), and as administrators without having to switch users, log off, or use Run As. A standard user account is synonymous with a user account in Windows XP. User accounts that are members of the local Administrators group will run most applications as a standard user. By separating user and administrator functions while enabling productivity, UAC is an important enhancement for Windows.

Disable UAC from the command line

%systemroot%System32cmd.exe /k %windir%System32reg.exe ADD HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem /v EnableLUA /t REG_DWORD /d 0 /f

Enable UAC from the command line

%systemroot%System32cmd.exe /k %windir%System32reg.exe ADD HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem /v EnableLUA /t REG_DWORD /d 1 /f

A couple caveats

  1. Must be run with administrative rights.  You could right-click on Command Prompt shortcut and select Run as Administrator.
  2. You may have to reboot for changes to take affect.

You can also enable or disable UAC from the Control Panel.

Categories
IIS 6 IIS 7 Win 7 Win7 Windows Windows 2008 Windows 7 Windows Vista Windows7

IIS 7 Log Files Default Location

In Internet Information Services 7 Microsoft changed the default log files location.

IIS 7 Log files location

%SystemDrive%inetpublogsLogFiles

IIS 6 Log files location

%windir%System32LogFiles

Categories
Linux Quick Launch TaskBar Win 7 Win7 Windows Windows 7 Windows7

How to Add Quick Launch to Windows 7 Task Bar

By default Windows 7 does not display quick launch on the taskbar like Windows XP and Vista.

How to Enable Quick Launch in Windows 7

  1. Right-click on taskbar.
  2. From Toolbars Menu select New Toolbar.
  3. Under Folder add: %appdata%MicrosoftInternet ExplorerQuick Launch then press Select Folder.
How to Unlock the Taskbar
  1. Unlock the taskbar by right-clicking on taskbar and select unlock the taskbar.
  2. To lock, do the same but select lock the taskbar.
Taskbar options
In Windows 7 quick launch you can choose whether to display the title and to show text or not.  To change these settings unlock the taskbar, right-click in the quick launch area of the taskbar and toggle Show Text and Show Title as desired.
Categories
FTP IIS 7 Linux SSL Win 7 Win7 Windows Windows 2008 Windows 7 Windows7

How to Install and Configure IIS 7 FTP Publishing Service

The new FTP Publishing Service 7.5 has been rewritten for Windows Server 2008 and lot of new futures and additions included. (Integration with IIS 7, FTP over SSL (from v7.0), Improved Logging, etc..)

Prerequisites
1. Internet Information Services 7.0 installed.
2. Windows Server 2008 or Vista.
3. Download FTP Publishing Service 7.5

4. Create a folder for FTP Publishing Service and allow Full access for Administrators

  • mkdir “c:inetpubftprootftp.mydomain.com”
  • cacls “c:inetpubftprootftp.mydomain.com” /G administrators:F /T /E

In case we want to add access to specific backup user we can use the following command”

  • cacls “c:inetpubftprootftp.mydomain.com” /G username:F /T /E

Permissions:

R  Read
W  Write
C  Change (write)
F  Full control

Installation
Before installing FTP Publishing Service 7.5 over IIS 7.0 be sure that you uninstall any previous versions of FTP Publishing Service.

  1. When the installation program of Microsoft FTP Service for IIS 7.0 begins, click Next.
  2. Accept the End-User License Agreement and click Next.
  3. Select the features you want to be installed and click Next.
  4. Click Install to begin the installation.
  5. At the end click Finish.

Creating the Certificate
After the installation finishes we open Internet Information Services 7.0  Manager and we select Server Certificates to create a self-signed SSL certificate. Another option is to create a certificate request to process with a 3rd party SSL provider which is recommended for production systems as they are from a trusted root.

Server Certificates

Click on Create Self-Signed Certificate…

Create a self-signed certificate

Specify a certificate name and click OK:

Specify certificate name


Creating the FTP Site
Right click the Sites node in the tree and click Add FTP Site…

Add FTP Site...

On the Add FTP Site wizard add the FTP site name and select the path we created in the prerequisites and click Next.

Add FTP Site Wizard

On the next page of the wizard we click the Require SSL option and we choose our SSL Certificate then we click Next.

Binding and SSL Settings

On the next page of the wizard we select Basic for Authentication and on Allow access to we select specified users and we define our backup ftp account with read and write permissions then we click on Finish. In case we want to allow anonymous ftp connections select Anonymous authentication and on Permissions we select the Read.

Authentication and Authorization Information


Configure the Firewall
If we are behind a firewall we should configure the FTP Firewall Support under Internet Information Services Manager and configure our firewall ports to accept passive connections on the ports we specify. In case we want to use dynamic port range under Data Channel Port Range we enter port range “0-0?.

FTP Firewall Support


Configure the FTP Client (FileZilla for example)
Configure FTP Client to connect to our FTP Site using FTP over explicit TLS/SSL.

FTP Client Settings


Troubleshooting
In case you get “534 Local policy on server does not allow TLS secure connections.” error this is because we need to select an SSL certificate at the Server Level.

FTP SSL Settings Server Level
FTP SSL Settings Certificate Selection

Categories
Context Menu Linux SSL Win 7 Win7 Windows Windows 7 Windows Vista Windows7

Reveal, Copy and Get File Full Path with Copy as Path in Windows Vista

Windows 7 (and Vista) comes with a hidden context-sensitive menu or right click menu or shortcut menu that contains Copy as Path menu item or command. Copy as Path, which appears as menu item both for files and folder right click menu, as the name implies, will copy or grab the full path or shortcut to the file or the folder with just one button press and one click. Copy as Path is useful when user want to know the full path or actual location of a file or folder located deep inside a tree of directories or network file share, but want to avoid the hassle to traverse or navigate the path, or avoid having to manually copy and paste from address bar and type the file name.

To use Copy as Path press shift while right-clicking which will reveal the hidden context menu. You will now see the Copy as Path and a couple other options. Click on Copy as Path, then you can paste the full path to the file or folder in your destination application.

Right click context menu without and with hidden menu items (appear only when press Shift key while right clicking).

Categories
Bloomberg Linux Microsoft News Operating System OS Video Win 7 Win7 Windows Windows 7 Windows7

Microsoft Launches Retail Store

Microsoft takes a new financial risk by getting into retail despite the economy. (The Trade)

This Bloomberg video brought to you by News Distribution Network.