VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    https://stackoverflow.com/questions/61397665/batch-file-to-get-all-available-graphics-...les-and-output

    I previously managed to do this thanks to above link that uses the now depreceated WMIC.

    Any ideas on how to do using powershell?

    Thanks.


    The nearest I could find searching was this ...

    But how to put result into a batch file variable ?


    https://lindevs.com/methods-to-get-available-gpu-devices-on-windows

    C:\> $gpu = (Get-WmiObject Win32_VideoController).Name
    C:\> $gpu
    Intel(R) UHD Graphics 620

    C:\> $gpu -like "Intel"
    False

    C:\> $gpu -like "*Intel*"
    True

    C:\> $gpu -like "Intel*"
    True
    Quote Quote  
  2. try ..
    Code:
    # Get the video controller information
    $gpuInfo = Get-WmiObject -Class Win32_VideoController
    There is nothing wrong with my environment
    Quote Quote  
  3. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Thanks for trying. When I open a powershell window (as Admin) and enter

    $gpu = (Get-WmiObject Win32_VideoController).Name

    I just get lots or red error messages?
    Quote Quote  
  4. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    I managed to get this to work below, (running from a batch file) sort of. But it incorrectly returned false for all tests.
    The weird thing is that when I ran it first (from within a powershell window, not batch file) I got some line, (6 lines) that returned true.
    But then further testing returned all false also as in batch file.

    I'm testing on a laptop that has a Nvidia GPU.


    Powershell $gpu -like 'nvidia'
    Powershell $gpu -like 'Nvidia'
    echo.
    Powershell $gpu -like '*nvidia*'
    Powershell $gpu -like '*Nvidia*'

    Powershell $gpu -like '*nvenc*'
    echo.
    Powershell $gpu -like 'nvidia*'
    Powershell $gpu -like 'Nvidia*'
    echo.
    pause
    exit
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!