Powershell to VBS conversion

Scripting Guru's

Need some help converting this PS script to a VBS. It is being used for OpsMgr.

$StdOut -match '.*%st'
$Value1 = [int32]($matches[0].Trim().Split(',')[3].Replace("%id","").Trim())

$StdOut -match '.*$'
$Value2 = [int32]($matches[0].Trim().Split(' ')[0])

$StdOut -match '^.*'
$Value3 = [int32]$matches[0]

Thanks!


April 23rd, 2015 12:15pm

Sorry, but this isn't a free code conversion service.

What have you tried?

Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 12:31pm

Dim pat1 = ".*%st"
Dim match1 as Match1 = Regex.Match1(stdOut, pat1)
Dim val1 = match1.Trim()
val1 = match1.Split(",")
val1 = match1.Replace("%id","")

April 23rd, 2015 1:36pm

It's not going to be possible to simply guess how to write the code.

You're going to actually have to read the documentation:

http://msdn.microsoft.com/en-us/library/d1wf56tt.aspx

Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 1:41pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics