package HowToCreateShortCutsInWindows;
#This package demonstrates how to create shortcuts with Perl in Windows (Tested on XP )
use File::Copy ;
use strict ;
use warnings ;
use File::Find ;
use File::Path ;
use Win32 ;
use Win32::Process ;
use Win32::OLE;
#perl2exe_include "attributes.pm";
our $userName = $ENV{USERNAME} ;
print "userName is $userName \n " ;
createShortTosome_exe();
sub createShortTosome_exe
{
$Win32::OLE::Warn = 3;
my $objWSHShell = Win32::OLE->new('WScript.Shell');
# Pass the path to the shortcut
my $objSC = $objWSHShell->CreateShortcut("C:\\Documents and Settings\\$userName\\Start Menu\\Programs\\Startup\\Shortcut_To_some_exe.lnk");
# Description - Description of the shortcut
$objSC->{Description} = 'Shortcut to my exe ';
# IconLocation – Path of icon to use for the shortcut file
$objSC->{IconLocation} = 'explorer.exe, 0';
# 0 is the index
# TargetPath = Path to source file or folder
$objSC->{TargetPath} = 'C:\\Temp\\some_folder\\some_exe.exe';
# Arguments – Any additional parameters to pass to TargetPath
$objSC->{Arguments} = 'C:\\Temp\\some_folder\\';
# WindowStyle – Type of window to create
$objSC->{WindowStyle} = 3;
# 1 = normal; 3 = maximize window; 7 = minimize
# WorkingDirectory – Location of the working directory for the source app
$objSC->{WorkingDirectory} = 'C:\\Temp\\some_folder';
$objSC->Save();
}
1 ;
__END__
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 !!!!