From a887ab74d721bc8f894e9473151511ec2ecbbfd9 Mon Sep 17 00:00:00 2001 From: Homes32 Date: Mon, 8 Jan 2024 21:23:34 -0600 Subject: [PATCH] additional examples for AddStartupConfig --- PhoenixAPI/AddStartupConfig.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/PhoenixAPI/AddStartupConfig.md b/PhoenixAPI/AddStartupConfig.md index 7d325f4..458376e 100644 --- a/PhoenixAPI/AddStartupConfig.md +++ b/PhoenixAPI/AddStartupConfig.md @@ -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)" ```