I am trying to write a perl script that determines which users are currently logging into Windows using query.exe (c: \ Windows \ system32 \ query.exe). Perl could not access this file, could not execute it, could not even see that it exists, as I found with the following code:
print `dir c:\\windows\\system32\\query*`;
This leads to the following conclusion:
07/13/2009 05:16 PM 1,363,456 Query.dll
1 File(s) 1,363,456 bytes
0 Dir(s) 183,987,658,752 bytes free
I checked the user executing the script function using the perl function getloginand returns the name of a member of the local Administrators group (in particular, me). I also tried to add read / execute permissions for "Everything", but at the same time I am trying to change the file permissions, but at the same time I have to refuse access. Finally, I tried to run perl.exe as an administrator, but this also does not fix the problem.
Can I solve this by changing some settings in Windows? Do I need to add something to my perl script? Or is there simply no way to provide perl access to some of these processes?
source
share