Configuring Windows to run SambaPOS in Kiosk mode

WARNING. GROUP POLICIES CONTAINS FEATURES THAT CAN LOCK DOWN YOUR COMPUTER. CREATE BACKUPS (INCLUDING WORKING IMAGES) BEFORE START AND FOLLOW ALL STEPS CAREFULLY.

THIS FEATURE WORKS FOR ONLY WINDOWS PRO AND UPPER VERSIONS.

YOU SHOULD BE AN ADMINISTRATOR.

BE SURE SAMBAPOS LOCAL SETTINGS CONFIGURED FINE FOR WINDOWS ACCOUNTS YOU’LL TEST.

Hello. Sorry for writing too much warnings. In this tutorial I’ll show you how to setup your terminals to only run SambaPOS. When a non-administrator windows user logs in SambaPOS will automatically start and automatically logoff when SambaPOS closed. Users will not be able to access anything other than SambaPOS.

##Preparing Script

First of all we need to prepare a script file that starts SambaPOS and log off automatically when SambaPOS closed. Open Notepad and paste this code into notepad.

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
errResult = objWMIService.Create("C:\Program Files (x86)\SambaPOS4\Samba.Presentation.exe", 
           "C:\Program Files (x86)\SambaPOS4\", null, intPosID)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colProcesses = objWMIService.ExecNotificationQuery _
    ("Select * From __InstanceDeletionEvent " _ 
            & "Within 1 Where TargetInstance ISA 'Win32_Process'")

Do Until False = True
    Set objProcess = colProcesses.NextEvent
    If objProcess.TargetInstance.ProcessID = intPosID Then
        Exit Do
    End If
Loop

Set wshShell =  WScript.CreateObject ("WScript.shell")
wshShell.run "c:\Windows\System32\shutdown.exe /l", 0, false

If you’ve installed SambaPOS to a different location other than default correct highlighted parts.

Name this file as SambaStart.vbs and save it under C:\Scripts folder.

:bulb: If you have multiple terminals you can save SambaStart.vbs file under a network location. In this case be sure SambaPOS installed under same local folder (eg. [Program Files]\SambaPOS4) on all terminals.

You can test this script by double clicking on it. Since it will automatically log off be sure you’ve closed all running applications and saved all documents. When double clicked it should start SambaPOS and log off when you close it.

##Accessing GPO Editor Tool

GPO stands for Group Policy Object. To create a new GPO run mmc.exe by Windows + R command or if you are using windows 8 switch to tile desktop by clicking windows button and type mmc.exe. It should start Microsoft Management Console application.

From File Menu click Add/Remove Snap-in...

Select Group Policy Object Editor, Click Add

After clicking Add Group Policy Wizard will appear.

THIS STEP IS IMPORTANT
THIS STEP IS IMPORTANT

By default group policy will work for local computer (all users). To change this click Browse... That will display another dialog. Click Users tab.

Select Non-Administrators group from the list.

:bulb: Choosing Non-Administrators group means our setup will only work for non-administrator users.

When you click OK you should see Non-Administrators selected on Wizard dialog.

After Clicking Finish. button you should see selected snap-in on right side.

Click OK to Complete Configuration.

Now we can use GPO Editor tool. To access it later quickly you can click File > Save As to save a shortcut (.msc file) on Desktop or somewhere else.

##Configuration

Before starting please Double Check you are configuring it for Non-Administrators.

1. Starting SambaStart.vbs when a non administrator user logs in.

  • Click User Configuration > Administrative Templates > System.
  • Double Click Custom User Interface.

Custom User Interface setting editor should appear.

  • You should see Custom User Interface on top of screen.
  • Click Enable
  • Type wscript c:\Scripts\SambaStart.vbs /nologo /b as interface file name.

:bulb: If you’ve saved script file to a different location don’t forget to correct file path.

Clicking OK will save configuration.

2. Disabling Task Manager

  • Click User Configuration > Administrative Templates > System > Ctrl + Alt + Del Options.
  • Double Click Remove Task Manager

It will display Remove Task Manager setting Editor.

Click Enabled option and Click OK to Save.

##Operating

Configuring SambaPOS Kiosk mode completed. Now when you login to Windows with a non-administrator user SambaPOS should start automatically and when you close SambaPOS it should log-off. Non administrators should also can’t access any other windows function.

Thanks to @Jesse for mentioning this great windows feature. Since original discussion topic contains some more useful resources I’m linking it here.

5 Likes

This topic is now invisible. It will no longer be displayed in any topic lists. The only way to access this topic is via direct link.

This topic is now visible. It will be displayed in topic lists.

I would like to mention that it is also possible to design it so it automatically logs the user in that launches Samba and it would automatically log in if logged out. (Useful if you lose power or something causes the terminal to reboot) You could enable ctrl alt del to switch into admin user but disable Task manager, reboot, lock, etc.

This would make it completely automated and self contained so your employees would never need to mess with the user log in portion of the terminal they would always only see SambaPOS. You could also build your network so you can administer the terminals remotely without ever having to physically be at the terminal minimizing business disruptions.

@kendash

Would it be possible to explain how to do that? Specially the part where you can control the terminal remotely. I will love to have that. I was thinking to use Teamviewer

Another thing, I am trying to run the script and it says there is syntax error in line 4 character 93, I have SambaPOS 4 installed in the default location so I didn’t have to change the path. @emre

Thanks in advance

Are you using 32 or 64bit windows?

Not really sure why… but I used default install as well… and it put mine in:
C:\Program Files (x86)\SambaPOS4\SambaPOS4\

Yes. Widows 64bit.

The problem for the syntax error was solved by merging line 4 and 5 in one line on the script.

Would you recommend Teamviewer for controlling it remotely?

1 Like

I do not have much experience with team viewer… but windows remote control works great.

@emro
can you explain how Windows users assign Terminals?

@emre
@Jesse
I have done same as shown in the tutorial above, but the problem is samba is not opening automatically in non administrators. when i double click it works. I have put the script in "C:\Program Files (x86)\SambaPOS4\SambaStart.vbs. I don’t know why? can you help me solving the issue

In the tutorial it says inside the Custom User Interface setting editor: Type wscript c:\Scripts\SambaStart.vbs /nologo /b as interface file name.

Did you change this accordingly with your new file location?

Or simply follow it exactly as it says and put it in C:\Scripts folder

Technically you have not, you changed the file location.

1 Like

Put the path in quotes, as such:

wscript "c:\Program Files (x86)\SambaPOS4\SambaPOS4\SambaStart.vbs" /nologo /b

First im going to say this tutorial worked wonders form my fanless shuttle pc, it is running beautiful.

An issue I am having however is for my windows tablets. They come with preinstalled windows 8.1 core/basic edition so they are missing all the features required for the above tutorial. So, I am trying to figure out a different way. Is there a way to setup the same exact thing but on all accounts and just leave task manager available in which I can launch with a keyboard if I ever need to change any settings?

You cant do this at all without Pro version. I dont know how much it cost… but you can upgrade it to pro from within windows update. I think its Control Panel and then System. Windows 10 will be free if you sign up in first year and its due out end of this summer which is not that far away.

Do you know what they are planning to charge for windows 10? Retail price?
For a few machines I configured recently I used Win7 pro license from decommissioned machines. Only cost me £10 each and activated windows without problem. Although as OEM license you aren’t meant to use on other brand machine but since the original machine was broken for parts it isn’t used on two machines and activated fine.
Kept a couple spare after hearing pro versions would be upgradeable to 10.

Yeah I am aware of that however its $100 and I am trying to see my options before I spend any money.

Can I just do a selective startup and achieve the same exact thing as the tutorial above? Like I said I dont care to have 2 accounts I just want a way to launch windows with samba in the same exact manner as above but instead of logging out maybe just relaunch samba when someone exits.

@eddhasaj I would advise you not try anything like that you could perminately cripple your machine. @JTRTech windows 10 will be 100% free if you upgrade within first year and own a copy of windows 7 or up even if its pirated.

I mean there is absolutely no reason not to get window 10 for free.

Do you know why this wont work for v5. I had it working perfectly for v4 and just went into the script file and changed the 4 to 5 and it wont launch samba?

@kendash

The way this works would not be impacted with v5. You need to double check your setup make sure the script is launching correct file.

There are 2 specific lines you need to change did you change both and are you sure its the same path that you installed it in?

yup. I know that the script worked fine for v4 as I was just using it before I installed v5. I went into the script file and change the sambaPOS4 to sambaPOS5 at both spots. I tried to click the script to run it and nothing happens.

@kendash

Could you send me your script if you have one working for v5