Microsoft Windows Based Script Host Startup
The Run method starts a program running in a new Windows process. You can have your script wait for the program to finish execution before continuing. If a file type has been properly registered to a particular program, calling run on a file of that type executes the program. MS-DOS was a renamed form of 86-DOS – owned by Seattle Computer Products, written by Tim Paterson.Development of 86-DOS took only six weeks, as it was basically a clone of Digital Research's CP/M (for 8080/Z80 processors), ported to run on 8086 processors and with two notable differences compared to CP/M: an improved disk sector buffering logic, and the introduction of FAT12 instead of the. Why is there a Windows Host Process (Rundll32) in my Startup tab in Task Manager? I'm not sure if this is a Windows 10 default action, or if it came from some program I installed. Shouldn't rundll32.exe start automatically if it's needed? It's not a virus, I'm positive it's the official exe in System32. I'm just curious, wondering why it's there. All else, run System File Checker (SFC) on your Windows system. Open a windows command prompt and type the following command.
Runs a program in a new process.
WshShell object.
String value indicating the command line you want to run. You must include any parameters you want to pass to the executable file.
Optional. Integer value indicating the appearance of the program's window. Note that not all programs make use of this information.
Optional. Boolean value indicating whether the script should wait for the program to finish executing before continuing to the next statement in your script. If set to true, script execution halts until the program finishes, and Run returns any error code returned by the program. If set to false (the default), the Run method returns immediately after starting the program, automatically returning 0 (not to be interpreted as an error code).
The Run method returns an integer. The Run method starts a program running in a new Windows process. You can have your script wait for the program to finish execution before continuing. This allows you to run scripts and programs synchronously. Environment variables within the argument strCommand are automatically expanded. If a file type has been properly registered to a particular program, calling run on a file of that type executes the program. For example, if Word is installed on your computer system, calling Run on a *.doc file starts Word and loads the document. The following table lists the available settings for intWindowStyle.
intWindowStyle | Description |
---|---|
0 | Hides the window and activates another window. |
1 | Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time. |
2 | Activates the window and displays it as a minimized window. |
3 | Activates the window and displays it as a maximized window. |
4 | Displays a window in its most recent size and position. The active window remains active. |
5 | Activates the window and displays it in its current size and position. |
6 | Minimizes the specified window and activates the next top-level window in the Z order. |
7 | Displays the window as a minimized window. The active window remains active. |
8 | Displays the window in its current state. The active window remains active. |
9 | Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window. |
10 | Sets the show-state based on the state of the program that started the application. |
The following VBScript code opens a copy of the currently running script with Notepad.
The following VBScript code does the same thing, except it specifies the window type, waits for Notepad to be shut down by the user, and saves the error code returned from Notepad when it is shut down.
Copy Code |
---|
The following VBScript code opens a command window, changes to the path to C: , and executes the DIR command.
Reference
Exec Method (Windows Script Host)Microsoft Windows Based Script Host Startup
-->This topic describes how to use the Local Group Policy Editor (gpedit) to manage four types of event-driven scripting files.
Introduction
Group Policy allows you to associate one or more scripting files with four triggered events:
Computer startup
Computer shutdown
User logon
User logoff
You can use Windows PowerShell scripts, or author scripts in any other language supported by the client computer. Windows Script Host (WSH) supported languages are also used, including VBScript and Jscript. For more information about the editor, see Local Group Policy Editor.
Additional considerations
For more information about scripting, see the Group Policy Script Center (https://go.microsoft.com/fwlink/?LinkID=66013).
Local Group Policy Editor and the Resultant Set of Policy snap-in are available in Windows Server 2008 R2 and Windows 7 Professional, Windows 7 Ultimate, and Windows 7 Enterprise. For more information, see https://go.microsoft.com/fwlink/?LinkId=139815.
How to assign computer startup scripts
To assign computer startup scripts
Open the Local Group Policy Editor.
In the console tree, click Scripts (Startup/Shutdown). The path is Computer ConfigurationWindows SettingsScripts (Startup/Shutdown).
In the results pane, double-click Startup.
In the Startup Properties dialog box, click Add.
In the Add a Script dialog box, do the following:
In the Script Name box, type the path to the script, or click Browse to search for the script file in the Netlogon shared folder on the domain controller.
In the Script Parameters box, type any parameters that you want, the same way as you would type them on the command line. For example, if your script includes parameters called //logo (display banner) and //I (interactive mode), type //logo //I.
In the Startup Properties dialog box, specify the options that you want:
Startup Scripts for <Group Policy object>: Lists all the scripts that currently are assigned to the selected Group Policy object (GPO). If you assign multiple scripts, the scripts are processed in the order that you specify. To move a script up in the list, click it and then click Up. To move a script down in the list, click it and then click Down.
Add: Opens the Add a Script dialog box, where you can specify any additional scripts to use.
Edit: Opens the Edit Script dialog box, where you can modify script information, such as name and parameters.
Remove: Removes the selected script from the Startup Scripts list.
Show Files: Displays the script files that are stored in the selected GPO.
Microsoft Windows Based Script Host Startup Software
Additional considerations
To complete this procedure, you must have Edit setting permission to edit a GPO. By default, members of the Domain Administrators security group, the Enterprise Administrators security group, or the Group Policy Creator Owners security group have Edit setting permission to edit a GPO.
Startup scripts are run under the Local System account, and they have the full rights that are associated with being able to run under the Local System account.
Beginning in Windows Vista, startup scripts are run asynchronously, by default. This is a different behavior from earlier operating systems.
Setting startup scripts to run synchronously may cause the boot process to run slowly.
In Windows 7 and Windows Vista, startup scripts that are run asynchronously will not be visible. Enabling the Run Startup Scripts Visible policy setting will have no effect when running startup scripts asynchronously.
Local Group Policy Editor and the Resultant Set of Policy snap-in are available in Windows Server 2008 R2 and Windows 7 Professional, Windows 7 Ultimate, and Windows 7 Enterprise. For more information, see https://go.microsoft.com/fwlink/?LinkId=139815.
How to assign computer shutdown scripts
To assign computer shutdown scripts
Open the Local Group Policy Editor.
In the console tree, click Scripts (Startup/Shutdown). The path is Computer ConfigurationWindows SettingsScripts (Startup/Shutdown).
In the results pane, double-click Shutdown.
In the Shutdown Properties dialog box, click Add.
In the Add a Script dialog box, do the following:
In Script Name, type the path to the script, or click Browse to search for the script file in the Netlogon shared folder on the domain controller.
In Script Parameters, type any parameters that you want, the same way as you would type them on the command line. For example, if your script includes parameters called //logo (display banner) and //I (interactive mode), type //logo //I.
In the Shutdown Properties dialog box, specify the options that you want:
Shutdown Scripts for <Group Policy object>: Lists all the scripts that are currently assigned to the selected Group Policy object (GPO). If you assign multiple scripts, the scripts are processed in the order that you specify. To move a script up in the list, click it and then click Up. To move a script down in the list, click it and then click Down.
Add: Opens the Add a Script dialog box, where you can specify any additional scripts to use.
Edit: Opens the Edit Script dialog box, where you can modify script information, such as name and parameters.
Remove: Removes the selected script from the Shutdown Scripts list.
Show Files: Displays the script files that are stored in the selected GPO.
Additional considerations
To complete this procedure, you must have Edit setting permission to edit a GPO. By default, members of the Domain Administrators security group, the Enterprise Administrators security group, or the Group Policy Creator Owners security group have Edit setting permission to edit a GPO.
Shutdown scripts are run as Local System, and they have the full rights that are associated with being able to run as Local System.
Setting shutdown scripts to run synchronously may cause the shutdown process to run slowly.
Local Group Policy Editor and the Resultant Set of Policy snap-in are available in Windows Server 2008 R2 and Windows 7 Professional, Windows 7 Ultimate, and Windows 7 Enterprise. For more information, see https://go.microsoft.com/fwlink/?LinkId=139815.
How to assign user logon scripts
To assign user logon scripts
Open the Local Group Policy Editor.
In the console tree, click Scripts (Logon/Logoff). The path is User ConfigurationWindows SettingsScripts (Logon/Logoff).
In the results pane, double-click Logon.
In the Logon Properties dialog box, click Add.
In the Add a Script dialog box, do the following:
In Script Name, type the path to the script, or click Browse to search for the script file in the Netlogon shared folder on the domain controller.
In Script Parameters, type any parameters that you want, the same way as you would type them on the command line. For example, if your script includes parameters called //logo (display banner) and //I (interactive mode), type //logo //I.
In the Logon Properties dialog box, specify the options that you want:
Logon Scripts for <Group Policy object>: Lists all the scripts that currently are assigned to the selected Group Policy object (GPO). If you assign multiple scripts, the scripts are processed in the order that you specify. To move a script up in the list, click it and then click Up. To move a script down in the list, click it and then click Down.
Add: Opens the Add a Script dialog box, where you can specify any additional scripts to use.
Edit: Opens the Edit Script dialog box, where you can modify script information, such as name and parameters.
Remove: Removes the selected script from the Logon Scripts list.
Show Files: Displays the script files that are stored in the selected GPO.
Additional considerations
To complete this procedure, you must have Edit setting permission to edit a GPO. By default, members of the Domain Administrators security group, the Enterprise Administrators security group, or the Group Policy Creator Owners security group have Edit setting permission to edit a GPO.
Setting logon scripts to run synchronously may cause the logon process to run slowly.
Logon scripts are run as User, not Administrator, and their rights are limited accordingly.
Local Group Policy Editor and the Resultant Set of Policy snap-in are available in Windows Server 2008 R2 and Windows 7 Professional, Windows 7 Ultimate, and Windows 7 Enterprise. For more information, see https://go.microsoft.com/fwlink/?LinkId=139815.
How to assign user logoff scripts
To assign user logoff scripts
Open the Local Group Policy Editor.
In the console tree, click Scripts (Logon/Logoff). The path is User ConfigurationWindows SettingsScripts (Logon/Logoff).
In the results pane, double-click Logoff.
In the Logoff Properties dialog box, click Add.
In the Add a Script dialog box, do the following:
In Script Name, type the path to the script, or click Browse to search for the script file in the Netlogon shared folder on the domain controller.
In Script Parameters, type any parameters that you want, the same way as you would type them on the command line. For example, if your script includes parameters called //logo (display banner) and //I (interactive mode), type //logo //I.
In the Logoff Properties dialog box, specify the options the you want:
Logoff Scripts for <Group Policy object>: Lists all the scripts that currently are assigned to the selected Group Policy object (GPO). If you assign multiple scripts, the scripts are processed in the order that you specify. To move a script up in the list, click it and then click Up. To move a script down in the list, click it and then click Down.
Add: Opens the Add a Script dialog box, where you can specify any additional scripts to use.
Edit: Opens the Edit Script dialog box, where you can modify script information, such as name and parameters.
Remove: Removes the selected script from the Logoff Scripts list.
Show Files: Displays the script files that are stored in the selected GPO.
Additional considerations
To complete this procedure, you must have Edit setting permission to edit a GPO. By default, members of the Domain Administrators security group, the Enterprise Administrators security group, or the Group Policy Creator Owners security group have Edit setting permission to edit a GPO.
Logoff scripts are run as User, not Administrator, and their rights are limited accordingly.
Setting logoff scripts to run synchronously may cause the logoff process to run slowly.
Local Group Policy Editor and the Resultant Set of Policy snap-in are available in Windows Server 2008 R2 and Windows 7 Professional, Windows 7 Ultimate, and Windows 7 Enterprise. For more information, see https://go.microsoft.com/fwlink/?LinkId=139815.