Windows 10, Custom User Interface, IniRead always returns ERROR? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kinnex
Posts: 22
Joined: 09 Jun 2016, 07:52

Windows 10, Custom User Interface, IniRead always returns ERROR?

09 Aug 2016, 16:46

By "Custom User Interface" I am referring to the Windows XP/Vista/7/8/10 ... Group Policy Object for "User Configuration/Policies/Administrative Templates/System/Custom User Interface" which allows you to run a custom program rather than the default explorer.exe

When I disable the GPO, running windows normally, the script works fine. Everything loads, values are read properly, etc.
When I enable the GPO, running the compiled ahk script as a Kiosk, the script fails. Every IniRead simply returns ERROR.

test.ahk (compiled into test.exe)

Code: Select all

#NoEnv
#Persistent

IniRead, t1, test.ini, Program, name
IniRead, t2, test.ini, Program, target

msgbox % "name = " . t1 . "`ntarget = " . t2

F1::
{
	Reload
	return
}
test.ini

Code: Select all

[Program]
name=Notepad
target=Notepad.exe
I am really not sure why it works one way, and not the other. :?
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: Windows 10, Custom User Interface, IniRead always returns ERROR?  Topic is solved

10 Aug 2016, 04:11

You have not specified a working directory or a path for the ini file, so your script is at the mercy of whichever process launched your script.
kinnex
Posts: 22
Joined: 09 Jun 2016, 07:52

Re: Windows 10, Custom User Interface, IniRead always returns ERROR?

10 Aug 2016, 07:48

Thank you Lexikos. I decided to try:

Code: Select all

#NoEnv
#Persistent

IniRead, t1, %A_ScriptDir%\test.ini, Program, name
IniRead, t2, %A_ScriptDir%\test.ini, Program, target

msgbox % "name = " . t1 . "`ntarget = " . t2

F1::
{
	Reload
	return
}
That works just fine in kiosk mode too.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Google [Bot], mikeyww, RussF and 184 guests