Sign in to follow this  
Followers 0
NuclearVW

IF [laptop is docked] or [connected to a network]

3 posts in this topic

Hello,

I am looking to write a script that only runs when my laptop is in the docking station.

How might I do this?

If this is impossible,I could also use an if statement for if my laptop is connected to a specific network.

Its my work laptop, and it only is connectd to the network if its docked, and I don't want my script to continue running if its not on the network.

T.I.A

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I like the idea of checking the network...another thing you can look into are your environment variables...run a CMD and enter Set with and without docking, and see if there are any differences you can key off of...possibly SESSIONNAME or USERDOMAIN

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Does this help?

$var = RegRead("HKEY_CURRENT_USER\Control Panel\PowerCfg", "CurrentPowerPolicy") ;Your power policies are numbered. When docked, it will become a different number from being undocked.
MsgBox(4096, "Your current power config policy is: ", $var)

RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0