#! perl -slw use strict; use Win32::API::Prototype;; { local $^W = 0; ## Ignore warning from Win32::API::Prototype ApiLink( 'kernel32', 'HANDLE GetCurrentProcess( )' ) or die $^E; ApiLink( 'kernel32', 'HRESULT SetPriorityClass( HANDLE p, DWORD c )' ) or die $^E; } SetPriorityClass( GetCurrentProcess(), -1 ); print "Check priority for process $$ in the Task Manager"; ## You should see that it has been set to 'LOW' ; #### #! perl -slw use strict; use Win32::Process; Win32::Process::Open( my $hProcess, $$, 0 ) or die $^E; $hProcess->SetPriorityClass( THREAD_PRIORITY_IDLE ); undef $hProcess; print "Check priority of process $$ in Task Manager"; ;