Internet Explorer KIOSK mode and hide a batch script
Posted by: bruntech in Microsoft Windows XP, scripting, tags: KIOSK, scriptingOpen a text editor like TextPad and copy this code:
Const HIDDEN_WINDOW = 12
strComputer = “.”
Set objWMIService = GetObject(”winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)
Set objStartup = objWMIService.Get(”Win32_ProcessStartup”)
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = HIDDEN_WINDOW
Set objProcess = GetObject(”winmgmts:root\cimv2:Win32_Process”)
errReturn = objProcess.Create(”cmd.exe /c c:\[name of your batch file].bat”, null, objConfig, intProcessID)
Make sure you replace [name of your batch file] with the name of your batch file you want to run. Save the file with a VBS extension. For example we save the file as kiosk.vbs (In this example I will use this script to call a batch file that launches Microsoft Internet Explorer.)
Create another file in your Text editor and save it as a batch .bat file. In your batch file, like for example launchIE.bat, put the following code:
:ie
“C:\Program Files\Internet Explorer\iexplore.exe”
goto :ie
This will launch Internet Explorer in an infinite loop. When Internet Explorer is closed, it will be reopen again. Now try your new batch file. Notice when you close Microsoft Internet Explorer, it will be launched again. To end this loop just close/exit out the console window, or as some may say DOS window.
Now comes the fun part. Launch the new visual Basic Script program by double clicking on it. Your batch file is now hidden from the user. This prevents the user from simply closing/exiting the console/DOS window to end the loop.
If you put this VBS script in your Run string in Hkey_Local_Machine\software\Microsoft\CurrentVersion\Run, your vbs program will launch as soon as the user logs into the pc.
- To do this simply open regedit
- browse to Hkey_Local_Machine\software\Microsoft\CurrentVersion\Run
- right click in the right pane and chose Add String and name it KIOSK
- double click on KIOSK string value
- type the following c:\Kiosk.vbs(make sure the visual basic script is here, otherwise use a different path)
- and click OK
The only way a user can close your batch script is by opening task manager and ending the task.
No Problem, we now move on to creating a local group policy that will lock out things like task manager, launching programs or evening accessing the hard drives with explorer, ( My Computer). Later on I will write an article about further locking down the pc with a group policy.
!! WARNING!! unless you are familiar with local Group policies, I would not attempt editing the local group policy, (gpedit) without the FULL understanding of what you are doing. You could brake your PC by making a wrong change in the local group policy, locking you out of your PC completely. !! WARNING !!
And finally if you edit your batch file again, with iexplore.exe -K [websiteaddress] , Microsoft Internet Explorer will run in KIOSK mode and open the web page that you passed to it.
When Internet Explorer runs in KIOSK mode, you are limited to the browser that is open and do not see the desktop. This would be same as pressing F11, but there is not a floating tool bar at the top. Be warned though, i would still create a local group policy that further locks down the PC since there are few ways to bypass the KIOSK mode of Internet Explorer.

Entries (RSS)
I get this message when I try to run this VBS script.
Windows Script Host
Script: c:viosk.vbs
Line: 3
Char:15 <——this is the left quote mark in the text strCoimputer = “.”
Code: 800A0408
Source: Microsoft VBScript compilation error
I think the coding is exactly as shown in this site. Help.
Just noticed that my VBS text does not have the extra i as shown in strCoimputer in my previous reply.
Rick - in your text editor replace the quotation marks, there’s a difference between ASCII and HTML generated ” ” correct, worked for me….
Good catch! Yes make sure the the quotes are ASCII. You can verify by copying into texpad or notepad and just back space the quotes and retype them. From your text editor, then save as a script etc.
Have replaced the quotes but this script doesn’t work for me. Doesn’t do anything
the batch file is an infinite loop, it opens several ie windows, could a /wait be used to stop it continuously opening ie windows?