Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Handle numbers be passed from vbs to perl

Status
Not open for further replies.

Phalanx1

Programmer
Jul 21, 2003
128
US
I made this script that searchs for specific processes and spits out information on them, i want to pass some information into a HTA page and do some stuff there with perlscript.

heres my vbs script searchs for some information on the required files.

Code:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each objItem in colItems
    If objItem.Description = "SurvivalLauncher.exe" then
    Wscript.Echo "CommandLine: " & objItem.CommandLine
    Wscript.Echo "CreationClassName: " & objItem.CreationClassName
    Wscript.Echo "CSCreationClassName: " & objItem.CSCreationClassName
    Wscript.Echo "CSName: " & objItem.CSName
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "ExecutablePath: " & objItem.ExecutablePath
    Wscript.Echo "ExecutionState: " & objItem.ExecutionState
    Wscript.Echo "Handle: " & objItem.Handle
end if
if objItem.Description = "IOProtect.exe" then
Wscript.Echo "CommandLine: " & objItem.CommandLine
    Wscript.Echo "CreationClassName: " & objItem.CreationClassName
    Wscript.Echo "CSCreationClassName: " & objItem.CSCreationClassName
    Wscript.Echo "CSName: " & objItem.CSName
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "ExecutablePath: " & objItem.ExecutablePath
    Wscript.Echo "ExecutionState: " & objItem.ExecutionState
    Wscript.Echo "Handle: " & objItem.Handle
end if
if objItem.Description = "survivalProject.exe" then
Wscript.Echo "CreationClassName: " & objItem.CreationClassName
    Wscript.Echo "CSCreationClassName: " & objItem.CSCreationClassName
    Wscript.Echo "CSName: " & objItem.CSName
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "ExecutablePath: " & objItem.ExecutablePath
    Wscript.Echo "ExecutionState: " & objItem.ExecutionState
    Wscript.Echo "Handle: " & objItem.Handle
end if
if objItem.Description = "sp.exe" then
Wscript.Echo "CSCreationClassName: " & objItem.CSCreationClassName
    Wscript.Echo "CSName: " & objItem.CSName
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "ExecutablePath: " & objItem.ExecutablePath
    Wscript.Echo "ExecutionState: " & objItem.ExecutionState
    Wscript.Echo "Handle: " & objItem.Handle
end if
Set colItems1 = objWMIService.ExecQuery("Select * from Win32_PrivilegesStatus",,48)
For Each objItem1 in colItems1
    if objItem.Description = "sp.exe" then
    Wscript.Echo "Operation: " & objItem1.Operation
    Wscript.Echo "ParameterInfo: " & objItem1.ParameterInfo
    Wscript.Echo "PrivilegesNotHeld: " & objItem1.PrivilegesNotHeld
    Wscript.Echo "PrivilegesRequired: " & objItem1.PrivilegesRequired
    Wscript.Echo "ProviderName: " & objItem1.ProviderName
    Wscript.Echo "StatusCode: " & objItem1.StatusCode
    end if 
    if objItem1.Description = "survivalProject.exe" then
    Wscript.Echo "Operation: " & objItem1.Operation
    Wscript.Echo "ParameterInfo: " & objItem1.ParameterInfo
    Wscript.Echo "PrivilegesNotHeld: " & objItem1.PrivilegesNotHeld
    Wscript.Echo "PrivilegesRequired: " & objItem1.PrivilegesRequired
    Wscript.Echo "ProviderName: " & objItem1.ProviderName
    Wscript.Echo "StatusCode: " & objItem1.StatusCode
    end if 
    if objItem1.Description = "IOProtect.exe" then
    Wscript.Echo "Operation: " & objItem1.Operation
    Wscript.Echo "ParameterInfo: " & objItem1.ParameterInfo
    Wscript.Echo "PrivilegesNotHeld: " & objItem1.PrivilegesNotHeld
    Wscript.Echo "PrivilegesRequired: " & objItem1.PrivilegesRequired
    Wscript.Echo "ProviderName: " & objItem1.ProviderName
    Wscript.Echo "StatusCode: " & objItem1.StatusCode
    end if
    If objItem1.Description = "SurvivalLauncher.exe" then
    Wscript.Echo "Operation: " & objItem1.Operation
    Wscript.Echo "ParameterInfo: " & objItem1.ParameterInfo
    Wscript.Echo "PrivilegesNotHeld: " & objItem1.PrivilegesNotHeld
    Wscript.Echo "PrivilegesRequired: " & objItem1.PrivilegesRequired
    Wscript.Echo "ProviderName: " & objItem1.ProviderName
    Wscript.Echo "StatusCode: " & objItem1.StatusCode
    end if

Set colItems2 = objWMIService.ExecQuery("Select * from Win32_SecuritySetting",,48)
For Each objItem2 in colItems2
    If objItem2.Description = "SurvivalLauncher.exe" then
    Wscript.Echo "ControlFlags: " & objItem2.ControlFlags
    Wscript.Echo "Description: " & objItem2.Description
    Wscript.Echo "SettingID: " & objItem2.SettingID
    end if
    if objItem2.Description = "IOProtect.exe" then
    Wscript.Echo "ControlFlags: " & objItem2.ControlFlags
    Wscript.Echo "Description: " & objItem2.Description
    Wscript.Echo "SettingID: " & objItem1.SettingID
    end if
    if objItem2.Description = "survivalProject.exe" then
    Wscript.Echo "ControlFlags: " & objItem2.ControlFlags
    Wscript.Echo "Description: " & objItem2.Description
    Wscript.Echo "SettingID: " & objItem2.SettingID
    end if
    If objItem2.Description = "SurvivalLauncher.exe" then
    Wscript.Echo "ControlFlags: " & objItem2.ControlFlags
    Wscript.Echo "Description: " & objItem2.Description
    Wscript.Echo "SettingID: " & objItem2.SettingID
    end if
    Next
    next
    next
 
you may need to change the datatype, but apart from that, there shouldn't be an issue I'd have thought.

You can pass them, but what do you want to do with them after, that's a different question

HTH
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ... smack the fecker
 
LOL

that's a good one, but what im soing with it is this. i have this program that does'nt like to be minimixed and has no minimize button, what i plan on doin with the handle is some thing like this
Code:
use Win32::API::Prototype;
ApiLink( 'user32.dll', 'HWND FindWindow( LPCTSTR pszClass, LPCTSTR pszTitle )' ) || die;
ApiLink( 'user32.dll', 'BOOL ShowWindow( HWND hWnd, int iCommand )' ) || die;

$Title = shift @ARGV;
# BEGIN CALLOUT A
if( $hWnd = FindWindow( 0, $Title ) )
# END CALLOUT A
{
	# Minimize the window.
	ShowWindow( $hWnd, 0x02 );
now if i can just remember how to get the window title ill be in business.

It's important to remember just one thing, "A mind is a terrible thing".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top