You are not logged in.
Hi guys!
I haven't scripted in a couple of years no, so dusting it off by trying to do "somewhat easy stuff".
This is how I want the script to work.
Give me the computer name
Set wshShell = WScript.CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
WScript.Echo "Computer Name: " & strComputerName
This gives me exactly what I want.
Then I want it to listen for a process
set service = GetObject ("winmgmts:")
for each Process in Service.InstancesOf ("Win32_Process")
If Process.Name = "xxxxx.exe" then
wscript.echo "xxxxx running"
wscript.quit
End If
next
wscript.echo "xxxxxx not running"
This also works just fine. And gives me the result I want.
Here is where I need some help, I want to be able to create an if statement based on "Not running" and then,
have it sequence a .bat file from a server to initiate an installation. And this is where I understand why I should have kept my scripting up-2-date and not shelved it.
But there is another thing, could it be possible. Instead of making it echo the results,
have them display the comp name and if the process is running or not with a MsgBox statement?
I am for the moment, blinded so I can't see what I am missing out of.
Any help would be greatly appreciated.
//Iglooo
Offline
All you need is to expand your IF...THEN to an IF...THEN...ELSE
Offline