How to connect to a wireless Display adapter automatically through scripts or Task Scheduler?

1

I am trying to project files to a Samsung TV which has a windows display adapter. I want to automate the entire process. So when the TV is switched on, I want the computer to continuously check for the display adapter and connect automatically. Once its connected I already have it projecting in a duplicate mode which displays files via another batch file running. Could anyone suggest how can I do this through scripts or task scheduler or powershell?

Bhavik

Posted 2016-04-07T21:28:39.273

Reputation: 11

Welcome to Super User! Please note that [SU] is not a script writing service. If you tell us what you have tried so far (including any scripts you are using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.

– DavidPostill – 2016-04-08T09:34:50.317

@DavidPostill : Hey I apologize for the incomplete information. I'm trying to use the following command to firstly test it with my WiFi and then try to go ahead with display adapter on TV. This is the command I'm using netsh wlan connect ssid=Jet Business Loans - Guest name=Jet Business Loans - Guest interface="Wireless Network Connection" and I'm getting this error : One or more parameters for the command are not correct or missing. – Bhavik – 2016-04-08T15:42:10.073

Answers

0

Sub Connetti()

        'Wscript.Sleep(500)
        Set objShell = CreateObject("Wscript.Shell")
        objShell.Run "%windir%\explorer.exe ms-settings-connectabledevices:devicediscovery"
        Wscript.Sleep(800)
        objShell.SendKeys "{Tab}"
        objShell.SendKeys "+{Tab}"
        objShell.SendKeys "{Enter}"
        Wscript.Sleep(1000)
        objShell.SendKeys "Toshiba-XXX"
        Wscript.Sleep(1000)
        objShell.SendKeys "{Tab}"
        Wscript.Sleep(1000)
        objShell.SendKeys "{Enter}"
        'objShell.SendKeys "{Tab}"
        'objShell.SendKeys "{Enter}"
        objShell.SendKeys "{Esc}"
        Wscript.Sleep(500)
        objShell.SendKeys "{Esc}"

End sub

Brisk

Posted 2016-04-07T21:28:39.273

Reputation: 1

1Please explain how this works (what it does) and how to use it.  Please do not respond in comments; [edit] your answer to make it clearer and more complete. – Scott – 2019-02-17T00:17:00.993