additional examples for AddStartupConfig

Homes32
2024-01-08 21:23:34 -06:00
parent 763afd67ae
commit a887ab74d7

@@ -1,6 +1,6 @@
# AddStartupConfig
Add a free-form line of code to the startup config (PhoenixPE.au3).
Add a free-form line(s) of code to the startup config (PhoenixPE.au3).
## Syntax
@@ -27,7 +27,11 @@ None.
## Remarks
None.
See the AutoIt3 documentation for command syntax.
Note that in order to use commands or constants that require a UDF the UDF must be included in PhoenixPE.au3. For complex operations you might want to consider using a custom PhoenixPE-UserConfig.au3 file.
Be sure to escape double quotes, percents, etc.
## Related
@@ -39,6 +43,28 @@ Run a program on startup.
```pebakery
AddStartupConfig,PreShell,"SetSplashText(#$qRunning MyApp...#$q)#$xRunProgramWait(@SystemDir & #$q\MyApp.exe#$q, #$q--doSomething#$q, @ScriptDir, @SW_HIDE)"
```
### Example 2
Modify the registry during startup.
```
AddStartupConfig,PostConfig,"RegWrite(#$qHKLM\SYSTEM\SomeKey#$q, #$qSomeValue#$q, #$qREG_DWORD#$q, 0)"
```
### Example 3
This example demonstrates how to insert multiple commands at once to be run in sequence.
1. Set the splash text
1. Modify a registry entry
1. Run a program
1. Modify a registry entry again
```pebakery
AddStartupConfig,Network,"SetSplashText(#$qStarting Network List Service...#$q)#$xRegWrite(#$qHKLM\SYSTEM\Setup#$q, #$qSystemSetupInProgress#$q, #$qREG_DWORD#$q, 0)#$xRunProgramWait(@SystemDir & #$q\Net.exe#$q, #$qStart netprofm#$q, @ScriptDir, @SW_HIDE)#$xRegWrite(#$qHKLM\SYSTEM\Setup#$q, #$qSystemSetupInProgress#$q, #$qREG_DWORD#$q, 1)"
```