0

I would like write a script to automate a certain task on windows.

I use a monitor to extend the screen of my laptop but every time I remove the plug and reconnect the monitor I have to go on to desktop properties and display settings to extend the monitor and set the resolution.

Well I assume on LINUX you can do this by using shell scripting but I am not sure how to do this in windows.

From my research on the internet I have found that BASH scripts could be used to do this task automatically.

Please guys I don't need a software to do this I would like to write the script myself so that I can learn something as well.

I have read up on bash scripting but I cant find methods to access windows components and just to let you know I am an intermediate JAVA programmer. I guess I could use JAVA as well.

I hope my questions are clear.

Thank You

crazyghost
  • 17
  • 6

1 Answers1

1

Bash scripting is for *nix systems, the equivalent on windows is Batch Scripting.

Some quick googling indicates that this can be done through registry edits, but they would not take effect until the next reboot.

Other than that, it doesnt look like doing that through batch scripting is possible.

If you want to look at another programming language to do this, check out this answer

Community
  • 1
  • 1
Tadgh
  • 1,999
  • 10
  • 23
  • Bash scripting isn't just for Unix, you can use something like cygwin and do bash scripting on Windows. Having said that, going the AHK route or looking into PowerShell as the other poster indicated would be good. – Nerdtron Sep 25 '12 at 15:07
  • Thank You, the link that you provided me answered my question. – crazyghost Sep 29 '12 at 17:23
  • Even autohotkey is a good option if somebody is looking to get something done instantly without learning a specific programming language but if you are looking to create your own application then using JNA library with Java is a very good option. – crazyghost Sep 29 '12 at 17:25