Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Win32::Process::Hide did not return true value

by Abhijit10089 (Novice)
on Jun 11, 2013 at 12:59 UTC ( #1038252=perlquestion: print w/replies, xml ) Need Help??
Abhijit10089 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am working on a script to hide a process using Win32::Process::Hide but whenever i execute the below written code an error: "Win32/Process/ did not return a true value at line 5".

#!/usr/bin/perl use strict; use warnings; require Win32::Process::Hide; use Win32::Process; use Win32; my $processObj; my $filePath = $ARGV[0]; $filePath =~ s/\\/\\\\/g; sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } Win32::Process::Create($processObj, "$filePath", "", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); 1;

I am using Strawberry Perl, and have installed the Win32::Process::Hide.

Can some one please let me know what i am doing wrong?



Replies are listed 'Best First'.
Re: Win32::Process::Hide did not return true value
by syphilis (Chancellor) on Jun 11, 2013 at 23:16 UTC
    I think that error (or is it merely a warning ?) is normally avoided by adding 1; below the end of the code in the .pm file. That is, in, try changing:
    Win32::Process::Hide::HideProcess(); __END__
    Win32::Process::Hide::HideProcess(); 1; __END__

      I think that error (or is it merely a warning ?) is normally avoided by adding 1;

      FWIW, it does this by design, when it fails to hide perl.exe, it doesn't return true, so require warns

      Thanks for your reply, but even after adding 1; at the end of at location "C:\strawberry\cpan\build\Win32-Process-Hide-1.85-ADEtkQ\lib\Win32\Process\" & all other sub-directories of "C:\strawberry\cpan\build\Win32-Process-Hide-1.85-ADEtkQ\" but still receiving the same error.

      Any Other suggestions?

        Just tried the same code in Windows XP worked fine for Win32::Process::Hide but still the process was the TaskManager.

        Any other suggestions on how to hide the process from windows or hide it from other processes like running in a VM of its own.

Re: Win32::Process::Hide did not return true value
by Anonymous Monk on Jun 11, 2013 at 13:08 UTC

      Thanks for your reply, but i am using Windows 7 with no antivirus installed. And i know hiding process is nefarious, but I need to run a program twice in the same system(which wont work until one of those process is hidden)

        Any other suggestions?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1038252]
Approved by hdb
[ww]: Wonder what IEEE would have thought w/survey based on PM/perl
[ww]: s/thought/found/
[erix]: that title is a broken* sentence, no? But maybe that's deliberate
[karlgoethebier]: ww:My first thought, to be honest...
[erix]: and those authors' names don't look like native english speakers. Then again, neither am I :)
[karlgoethebier]: but the set of test persons is very small, like in medical studies: "We analyzed 50..."

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2017-09-25 14:47 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (280 votes). Check out past polls.