#!/usr/bin/perl use strict; use Win32::Process; my $ProcessObj; Win32::Process::Create($ProcessObj, "C:\\winnt\\system32\\notepad.exe", "notepad temp.txt", 0, NORMAL_PRIORITY_CLASS, ".")|| die "Oops"; my $exit_code = 1; my $wait=; chomp $wait; $ProcessObj->Kill($exit_code);