none
Is there a way to convert powershell script to VB script ?

    General discussion

  • Hi All,

    I wonder if it's possible to convert the following PS script to a VB script ?

    (get-childitem -path env:computername).Name +":" + (get-childitem -path env:computername).Value| out-file "c:\tpm\$env:COMPUTERNAME.csv"; get-tpm | out-file -append "c:\tpm\$env:COMPUTERNAME.csv"

    Thank you.

    • Changed type Bill_Stewart Friday, March 15, 2019 5:25 PM
    • Moved by Bill_Stewart Friday, March 15, 2019 5:25 PM This is not "translate script into a different language for me" forum
    Wednesday, January 9, 2019 1:46 AM

All replies

  • This is not the right place to ask others to rewrite scripts into a different language for you.

    However, if you have a specific scripting question, feel free to ask.


    -- Bill Stewart [Bill_Stewart]

    Wednesday, January 9, 2019 2:00 AM
  • Your PS script is bogus and does nothing usefule in many lines.  It's equivalent is:

    Get-Tpm | Out-File tpm.txt

    This cannot be done in VBScript directly. It would require WMI acess in VBScript.

    There is absolutely no reason to do it in VBS.  VBS is mostly obsolete.


    \_(ツ)_/

    Wednesday, January 9, 2019 2:09 AM
  • There's a reason I make it this way. I want to make a csv file that contain computer name and the tpm status of that machine and I want to make it easy to split the column in Microsoft Excel.
    Thursday, January 10, 2019 6:40 AM
  • I urgently recommend for you to start to learn the very basics of Powershell.
    Invoke-Command -ComputerName $env:COMPUTERNAME -ScriptBlock {
        get-tpm 
    } |
        Select-Object -Property * |
            Export-Csv -Path tpm.csv -NoTypeInformation

    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    Thursday, January 10, 2019 8:45 AM