Welcome!

Welcome to Satlover forums, full of great people, ideas and excitement.

Please register if you would like to take part. link..

Register Now

Alert: Don't Use Hotmail Email Accounts for registration

Collapse

Before Access to all Forums and Trial accounts you must need to activate your account Email address

PowerShell Enable/Disable DVB Card before starting DVB Program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • uttnls
    • Dec 2024

    PowerShell Enable/Disable DVB Card before starting DVB Program

    This is a little more advanced tutorial, if presents interest i will provide a simple batch script :

    Ok Lets start in windows 7 by running powershell :

    Start -> Search Programs and Files -> PowerShell -> Right click on icon -> Run as Administrator

    Now list your network devices :

    PS C:\> Get-WmiObject win32_networkadapter

    Look in results for DVB Card and take the DeviceID, then replace it here (see red number), and run the command

    PS C:\> $DVB = Get-WmiObject win32_networkadapter | where {$_.DeviceId -eq 4}

    To disable use

    PS C:\> $DVB.disable()

    To enable use

    PS C:\> $DVB.enable()

    This can be included in a batch to :

    1. Identify network card Object
    2. Disable Card
    3. Enable Card
    4. Start DVB Program
  • os2222
    Senior Member
    • Jan 2011
    • 175

    #2
    Re: PowerShell Enable/Disable DVB Card before starting DVB Program

    first: this is awesome! it works without problems

    but for not so expertised users i have a few tips:
    1st: you have to run PowerShell as an Administrator (right-click and choose run as administrator)
    2nd: from the output of "Get-WmiObject win32_networkadapter" you habe to search for the DeviceID, not the CardID

    Comment

    • uttnls

      #3
      Re: PowerShell Enable/Disable DVB Card before starting DVB Program

      Yes you are right,

      First i completly forgot about to mention "Run as Administrator"

      Secondly i blame cccam for writing CardID instead of DeviceID ))

      Thanks for good pointed corrections

      Comment

      • os2222
        Senior Member
        • Jan 2011
        • 175

        #4
        Re: PowerShell Enable/Disable DVB Card before starting DVB Program

        no problem

        by the way: i wrote a script for this one. it disables and enables the skystar. no need to change anything in this one. it automatically detects your card.

        Put this into a text-file and save it as dvbreset.ps1
        set-executionpolicy unrestricted
        $DVB = Get-WmiObject win32_networkadapter | where {$_.Name.Contains("DVB-PC")}
        $DVB.disable()
        echo "DVB-Card deactivated. Please wait for activation!"
        sleep 5
        $DVB.enable()
        Now go on and create a new shortcut somewhere and put this one as the target
        C:\Windows\System32\WindowsPowerShell\v1.0\powersh ell.exe -command C:\THE\PATH\TO\dvbreset.ps1
        You then can right click on the shortcut and choose run as administrator. Watch your Skystar go down and up

        if this doesn`t work for you:
        Once start PowerShell manually with administrative rights. Put this one into the shell
        set-executionpolicy unrestricted
        Hit enter and choose YES (Y). Now the script should run for shure.

        Comment

        • uttnls

          #5
          Re: PowerShell Enable/Disable DVB Card before starting DVB Program

          Ok and at the end you can add your DVB program path, and you have a full enable/disable and start of DVB program like this

          At the end off os2222 script add this for ProgDVB :


          Code:
          sleep 5s 
          start "C:\Program Files (x86)\ProgDVB\ProgDvbNet.exe"

          Increase sleep if you have ptoblems on detecting the card

          Comment

          • os2222
            Senior Member
            • Jan 2011
            • 175

            #6
            Re: PowerShell Enable/Disable DVB Card before starting DVB Program

            hehe you`re right.
            forgot to mention that you can start your dvb-s proggy after the script runs.
            so you have all together with just one click. couldnt be easier

            Comment

            • uttnls

              #7
              Re: PowerShell Enable/Disable DVB Card before starting DVB Program

              They have to pay attention to that delay of 5s, if the DVB starts and the card is not yet complety reset, it can give some errors.

              On me 5s is ok, test it please and confirm if this is also working for you

              Comment

              • os2222
                Senior Member
                • Jan 2011
                • 175

                #8
                Re: PowerShell Enable/Disable DVB Card before starting DVB Program

                Tested and confirmed. My computer is not the fastest one and I managed to set the timeout to 2 secs without any problems

                Comment

                • uttnls

                  #9
                  Re: PowerShell Enable/Disable DVB Card before starting DVB Program

                  Ok then this is the final script for reset skystar2 and starting ProgDVB
                  Code:
                  set-executionpolicy unrestricted
                  $DVB = Get-WmiObject win32_networkadapter | where {$_.Name.Contains("DVB-PC")}
                  $DVB.disable()
                  echo "DVB-Card deactivated. Please wait for activation!"
                  sleep 5
                  $DVB.enable() 
                  sleep 5s 
                  start "C:\Program Files (x86)\ProgDVB\ProgDvbNet.exe"
                  credits also to os2222

                  Comment

                  • cdr_pro
                    Junior Member
                    • Mar 2011
                    • 12

                    #10
                    Re: PowerShell Enable/Disable DVB Card before starting DVB Program

                    How does this work, when i am using the bda drivers?

                    Comment

                    • uttnls

                      #11
                      Re: PowerShell Enable/Disable DVB Card before starting DVB Program

                      Originally posted by cdr_pro
                      How does this work, when i am using the bda drivers?
                      You have to change the object, this script looks in networkadapter object but the Skystar2 + BDA is not seen as a networkadapter.

                      That's why is not working

                      Comment

                      • cdr_pro
                        Junior Member
                        • Mar 2011
                        • 12

                        #12
                        Re: PowerShell Enable/Disable DVB Card before starting DVB Program

                        OK, but what's the correct object?
                        It is listed under "Audio, Video, Game Controler"

                        Comment

                        • uttnls

                          #13
                          Re: PowerShell Enable/Disable DVB Card before starting DVB Program

                          Let's do it then for BDA users also :

                          Open your Powershell and tell me the output of this coomand to be able to make the script work with BDA Drivers:

                          Get-WmiObject Win32_SoundDevice

                          Comment

                          • cdr_pro
                            Junior Member
                            • Mar 2011
                            • 12

                            #14
                            Re: PowerShell Enable/Disable DVB Card before starting DVB Program

                            Sorry, but this list only my sound chip. :-(

                            Comment

                            • uttnls

                              #15
                              Re: PowerShell Enable/Disable DVB Card before starting DVB Program

                              Originally posted by cdr_pro
                              Sorry, but this list only my sound chip. :-(
                              Then try get-WmiObject win32_videocontroller and put here the outputs

                              Comment

                              Working...