How do I script Windows?

  • Thread starter newjerseyrunner
  • Start date
  • Tags
    Windows
In summary, Microsoft makes it really hard to set up a new server, and the documentation is outdated and difficult to follow.
  • #1
1,533
637
I'm starting to get really annoyed trying to script a new server installation. I found out I have to go into some control panel, make some adjustments, click next, next, then save. No. Just xxx no!

Why is there no documentation anywhere that I can find about how to do it easily? How do I make changes to the control panel without actually going through the stupid control panel? Where are the files that these settings are actually stored in?

"Oh, I want to make changes to my network." - Microsoft Sally
"Okay, instead of having an /etc/network.d, let's give the user all these windows and buttons because it looks pretty." - Microsoft Dick
"Why not make it easier for the tech people who actually have to do these operations and don't care about or even plan on seeing those buttons and have to do it on entire racks of servers all at once?"- Microsoft Sally
"F*ck those people."- Microsoft Dick

Where is documentation on the inner workings of this stupid operating system?

Or, maybe somebody just knows. Where is the Local Server Roles so that I can enable Windows Media Server?

/rant/question
 
Computer science news on Phys.org
  • #2
Have you tried msconfig in the command line? O.k., it's not a batch, but maybe less to click though.
 
  • Like
Likes newjerseyrunner
  • #3
It's been something I've been looking into for doing this. It looks like it allows you to basically script what the mouse and keyboard are doing, is that right?
 
  • #4
? You can try it without risk as long as you do not make changes. It allows you to control startup procedures and services as a whole. There have been also default paths and variables in earlier versions somewhere, but I have forgotten where or if it is still available outside the registry. The latter can also be manually adjusted by regedit in the command line. (But make a copy of it before doing so. You can destruct the OS there.) But to switch on and off services msconfig should do.
 
  • #5
newjerseyrunner said:
I'm starting to get really annoyed trying to script a new server installation. I found out I have to go into some control panel, make some adjustments, click next, next, then save. No. Just f*cking no!
There are several ways of doing this:
  • The advanced way: Learn to create an installation file (*.msi). Warning: This is complex!
  • The Command Prompt way: Learn Powershell and all its associated commands.
  • The hacker way: Get hold of one of those utilities that can record your key presses and mouse clicks, record your actions and use the record to play back the actions.
There may be more options, but these are just off the top of my head.
 

1. How do I create a script in Windows?

To create a script in Windows, you can use a text editor such as Notepad or a specialized scripting program like Windows PowerShell. Simply write your script using the appropriate scripting language, save the file with a .bat or .ps1 extension, and your script is now ready to be executed.

2. What programming languages can I use to script in Windows?

There are several programming languages you can use to script in Windows, including batch scripting (using .bat files), PowerShell scripting (using .ps1 files), and VBScript (using .vbs files). You can also use other languages such as Python or JavaScript by installing a specific interpreter or framework.

3. How do I run a script in Windows?

To run a script in Windows, you can either double-click on the script file or execute it from the command line by typing its file name followed by the appropriate extension (e.g. myscript.bat or myscript.ps1). Make sure the script is saved in a location that is included in your system's PATH variable for easy execution.

4. Can I schedule a script to run automatically in Windows?

Yes, you can schedule a script to run automatically in Windows using the Task Scheduler tool. This allows you to specify a specific time or event to trigger the script's execution, making it easier to automate repetitive tasks.

5. How do I troubleshoot errors in my Windows script?

If your script is not running as expected, you can troubleshoot errors by checking the script's syntax and logic for any mistakes. You can also add debugging statements or use a debugger tool to track the execution of your script. Additionally, referring to online forums or consulting with other experienced scripters can help identify and resolve any issues.

Suggested for: How do I script Windows?

Replies
12
Views
282
Replies
6
Views
1K
Replies
7
Views
263
Replies
5
Views
963
Replies
3
Views
2K
Replies
4
Views
2K
Replies
6
Views
2K
Replies
5
Views
113
Replies
4
Views
1K
Back
Top