Recent

Author Topic: Can't execute ie4uinit.exe in Windows 8 x64  (Read 8134 times)

lainz

  • Guest
Can't execute ie4uinit.exe in Windows 8 x64
« on: January 25, 2013, 10:53:02 pm »
Hi, I want to run this file

ie4uinit.exe with the paramenter -ClearIconCache

I'm using this code:

Code: [Select]
RunCmdFromPath('ie4uinit.exe', '-ClearIconCache');
("C:\Windows\System32\ie4uinit.exe")

In Windows 8 x64 i get
'program file not found ie4uinit.exe'


But the file is there :)

Edit: also running as administrator it doesn't works..
I have Lazarus x86, so my project is 32 bit. No idea if this works if I compile that code as 64 bit.

I've tested this code and works in Windows 7 32 bit.
« Last Edit: January 25, 2013, 10:55:49 pm by lainz »

wjackson153

  • Sr. Member
  • ****
  • Posts: 267
Re: Can't execute ie4uinit.exe in Windows 8 x64
« Reply #1 on: January 25, 2013, 11:20:27 pm »
Sounds like Your win 8 os is handling the path differently ?

Can you read the path into a string var and see if it matches
sometimes I hear windows do funny things to paths, like adding
empty char to the end ??
path := ExtractFilePath(Application.ExeName);

// This line was changed to  the line below showmessage(path);
if there is a invisible char showmessage will  not rereal it.
so we should instead do something line

memo1.text := path;
and compare length(path);  with actual win 8 path

C:\Windows\System32\ie4uinit.exe  this line = 32 chars
so if path is more then 32 char we have found win 8 added char


but i wander if you could  instead use Tprocess with parameters

launching the cmd.exe  and passing 'ie4uinit.exe', '-ClearIconCache' as
your pameters  this works on linux  using sh   should be same concept
as cmd.exe on windows but i don't use windows so just a thought ?

Read my post on Tprocess execute method

rather then use sh  with -c
try to cmd.exe  or whatever the extention is perhaps not even need to know extention.

After some reading on cmd  i found that you can use /c  in the place of -c
in my code. You should be good to go just change needed parmeter and the executable
to cmd :)




http://wiki.lazarus.freepascal.org/Executing_External_Programs#A_Simple_Example

If using Tprocess executable with parmeters don't work for you try
the depreciated method using commandline  instead

Hope this helps

« Last Edit: January 26, 2013, 12:00:27 am by wjackson153 »
Lazarus 1.1 r39490 CT FPC 2.7.1 i386-linux KDE
Linux Mint 14 KDE 4

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12706
  • FPC developer.
Re: Can't execute ie4uinit.exe in Windows 8 x64
« Reply #2 on: January 26, 2013, 12:17:26 am »
Hi, I want to run this file

ie4uinit.exe with the paramenter -ClearIconCache

I'm using this code:

Code: [Select]
RunCmdFromPath('ie4uinit.exe', '-ClearIconCache');
("C:\Windows\System32\ie4uinit.exe")

In Windows 8 x64 i get
'program file not found ie4uinit.exe'


But the file is there :)

on win8/64 in a simple cmd.exe shell I have the same behaviour.

The c:\windows\system32 dir _IS_ in the %PATH%, but beyond the 256 char l

It _DOES_ work if I use full path, but even if I CD into system32 and run "ie4unit" it is not found. Cygwin
utils (file and hexdump) don't work on it either.

If I copy it, it is a normal file:

C:\1>file ie4uinit.exe
ie4uinit.exe: PE32+ executable (GUI) x86-64, for MS Windows

Looks like it is part of a junction. Anyway, running with fullpath seems to work.

lainz

  • Guest
Re: Can't execute ie4uinit.exe in Windows 8 x64
« Reply #3 on: January 26, 2013, 12:22:54 am »
Ok thanks to both.

Seems that the procedure is working well and the problem is a Windows thing.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Can't execute ie4uinit.exe in Windows 8 x64
« Reply #4 on: January 26, 2013, 01:16:11 pm »
Try c:\windows\syswow64 (IIRC) which is where 32 bit equivalents to the system dir 64 bit programs are.

There should be an environment variable or api call that points to it, might already be documented on the windows tips wiki page.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018