# This code creates a shortcut.
# ---------------------------------------------------------------
# Adapted from VBScript code contained in the book:
# "Windows Server Cookbook" by Robbie Allen
# ISBN: 0-596-00633-0
# ---------------------------------------------------------------
use Win32::OLE;
$Win32::OLE::Warn = 3;
$objWSHShell = Win32::OLE->new('WScript.Shell');
# Pass the path to the shortcut
$objSC = $objWSHShell->CreateShortcut('C:\\Documents and Settings\\yogeorgi\\Desktop\\Shortcut to settings.lnk');
# Description - Description of the shortcut
$objSC->{Description} = 'Shortcut to MyLog settings.txt';
# HotKey – hot key sequence to launch the shortcut
#if one puts space between the + and the ALT SHIFT etc. this raizes exception
$objSC->{HotKey} = 'CTRL+ALT+SHIFT+S';
# IconLocation – Path of icon to use for the shortcut file
$objSC->{IconLocation} = 'notepad.exe, 0';
# 0 is the index
# TargetPath = Path to source file or folder
$objSC->{TargetPath} = 'C:\\Temp\\QARunpack\\settings.txt';
# Arguments – Any additional parameters to pass to TargetPath
$objSC->{Arguments} = 'c:\\mylog.txt';
# WindowStyle – Type of window to create
$objSC->{WindowStyle} = 1;
# 1 = normal; 3 = maximize window; 7 = minimize
# WorkingDirectory – Location of the working directory for the source app
$objSC->{WorkingDirectory} = 'c:\\Temp\\QARunpack';
$objSC->Save();
print "Shortcut to mylog created\n";
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
2 weeks ago
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!