emendelson

IniRead("system.ini", "boot", "shell", " ") always returns explorer.exe

3 posts in this topic

#1 ·  Posted (edited)

Here is something very strange. Take these two absolutely identical files, one named system.ini, the other named system.inf. (They are from a Windows 3.11 setup.)

Create this script in the same folder:

Local $a = IniRead("system.ini", "boot", "shell", "")
Local $b = IniRead("system.inf", "boot", "shell", "")
MsgBox(0, '', $a & @CRLF & $b)

On my Windows 7 32-bit system, the first line returns "explorer.exe" (which does not appear in the file) and the second line correctly returns "progman.exe". 

"explorer.exe" gets returned even if I type in the correct full path of the system.ini file that contains the line shell=progman.exe. The correct item gets returned if I change the filename from system.ini to temp.ini - but "system.ini" always returns explorer.exe. Other keys in the same section are returned correctly, but the combination of "system.ini", "boot", and "shell" always returns "explorer.exe".

I can't find a clue to this anywhere in the help file. My C:\WINDOWS folder has a system.ini (installed by Windows 7 by default), but it doesn't say "explorer.exe" anywhere. Where is this coming from?

SYSTEM.INI

SYSTEM.INF

Edited by emendelson
Clarification

Share this post


Link to post
Share on other sites



Had a similar issue a while ago clicky . It's to do with Windows and ini files. It maps a lot of the "system" ini files to the registry so the iniread function just returns those values. Still seems relevant today although the reg key isn't there. If you rename the ini file to .int or other it works.

InireadSection also fails.

Share this post


Link to post
Share on other sites

I wasn't aware of this.

And my W10 gave the same result as OP


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now