Steps to Run the Batch Script in Kiosk Mode
1. Prepare the Batch Script
Ensure your batch script (
start_server.bat
) is located in a secure and accessible location, such asC:\MayaWINX\
.Test the script to confirm it runs correctly in the background without requiring user interaction.
2. Run the Script as a Scheduled Task
Since the kiosk mode restricts access to the startup folder for the kiosk user, you can use Task Scheduler to run the script at system startup.
Steps:
Open Task Scheduler (
taskschd.msc
).Click Create Task in the right-hand pane.
In the General tab:
Name the task (e.g.,
StartServerScript
).Select Run whether user is logged on or not.
Check Do not store password (if applicable).
Check Run with highest privileges.
In the Triggers tab:
Click New.
Set the trigger to At startup.
In the Actions tab:
Click New.
Set Action to
Start a program
.Browse to your batch script (
C:\MayaWINX\start_server.bat
).
In the Conditions tab:
Uncheck any conditions that might prevent the script from running (e.g., "Start the task only if the computer is on AC power").
In the Settings tab:
Ensure Allow task to be run on demand is checked.
Uncheck Stop the task if it runs longer than (unless you want to set a time limit).
Click OK to save the task.
3. Test the Setup
Restart the computer to confirm the batch script runs automatically at startup.
Verify that the kiosk app (browser) launches correctly and the script runs in the background.
Alternative: Run the Script as a Service
If the batch script needs to run continuously and independently of user sessions, you can convert it into a Windows Service using a tool like NSSM (Non-Sucking Service Manager).
Steps:
Download and install NSSM from nssm.cc.
Open Command Prompt as Administrator.
Use NSSM to create a service:
cmd
Copynssm install StartServerService
In the NSSM GUI:
Set the Path to your batch script (
C:\MayaWINX\start_server.bat
).Configure the Startup directory (if needed).
Set the Startup type to Automatic.
Click Install service.
Start the service:
cmd
Copynet start StartServerService
Important Notes
Permissions: Ensure the batch script and any files it accesses have the correct permissions to run under the system or kiosk account.
Security: Kiosk mode is designed to restrict access, so ensure your script does not introduce vulnerabilities.
Testing: Thoroughly test the setup to ensure the script runs as expected without interfering with the kiosk app.
By using Task Scheduler or converting the script into a service, you can ensure your batch script runs automatically at startup in a Windows 11 Kiosk Mode environment.