Page 1 of 1 1
Topic Options
#198025 - 2010-03-10 08:00 PM KiXtart partially blind in Windows 7?
groon Offline
Just in Town

Registered: 2010-03-10
Posts: 4
Loc: Canada
I use KiXtart extensively in workstation deployment and automated software installations, and my employer is just now switching from XP to Windows 7. I have found KiXtart behaving unexpectedly under Windows 7 64-bit, particularly as it "sees" files in the SYSTEM32 folder. I don't know how to say it except that some files are for all intents and purposes "invisible" to KiXtart, even though ordinary batch files can see them fine.

Perhaps an example would help. Here is a simple batch file:

 Code:
@echo off
echo Checking attribute:
attrib %systemroot%\system32\kix32.exe
echo.
echo (Removing read-only attribute)
attrib -r %systemroot%\system32\kix32.exe
echo Confirming attribute removal:
attrib %systemroot%\system32\kix32.exe
echo.
echo (Restoring read-only attribute)
attrib +r %systemroot%\system32\kix32.exe
echo Attributes of all k*.exe files:
attrib %systemroot%\system32\k*.exe
echo.
kix32 FileAttrTest.scr
echo.
echo Attributes of all k*.exe files:
attrib %systemroot%\system32\k*.exe
echo.
echo Permissions of all k*.exe files:
cacls %systemroot%\system32\k*.exe
pause
 


This is a demo batch which calls a KiXtart script to demonstrate the problem. Here is the KiXtart script:

 Code:
 "Checking attribute from KiX:" ?
shell "cmd.exe /c attrib %systemroot%\system32\kix32.exe"
? "(Removing read-only attribute from KiX)" ?
shell "cmd.exe /c attrib -r %systemroot%\system32\kix32.exe"
? "(Using KiXtart command to reset file attibutes)" ?
$rcode=setfileattr("%systemroot%\system32\kix32.exe",0)
@serror ?
? "Checking attributes of all k*.exe files from KiX:" ?
shell "cmd.exe /c attrib %systemroot%\system32\k*.exe"
? 


Now the results. One would expect the batch commands to have the same results as the KiXtart commands. However, right-clicking the batch file, choosing "Run as Administrator", using KiXtart 4.61, here is what is output by this example:

 Code:
 Checking attribute:
A    R       C:\Windows\system32\KIX32.EXE

(Removing read-only attribute)
Confirming attribute removal:
A            C:\Windows\system32\KIX32.EXE

(Restoring read-only attribute)
Attributes of all k*.exe files:
A    R       C:\Windows\system32\KIX32.EXE
A            C:\Windows\system32\klist.exe
A            C:\Windows\system32\ksetup.exe
A            C:\Windows\system32\ktmutil.exe

Checking attribute from KiX:
File not found - C:\Windows\system32\kix32.exe

(Removing read-only attribute from KiX)
File not found - C:\Windows\system32\kix32.exe

(Using KiXtart command to reset file attibutes)
The system cannot find the file specified.

Checking attributes of all k*.exe files from KiX:
A            C:\Windows\system32\ktmutil.exe


Attributes of all k*.exe files:
A    R       C:\Windows\system32\KIX32.EXE
A            C:\Windows\system32\klist.exe
A            C:\Windows\system32\ksetup.exe
A            C:\Windows\system32\ktmutil.exe

Permissions of all k*.exe files:
C:\Windows\system32\KIX32.EXE NT AUTHORITY\SYSTEM:(ID)F
                              BUILTIN\Administrators:(ID)F
                              BUILTIN\Users:(ID)R

C:\Windows\system32\klist.exe NT SERVICE\TrustedInstaller:F
                              BUILTIN\Administrators:R
                              NT AUTHORITY\SYSTEM:R
                              BUILTIN\Users:R

C:\Windows\system32\ksetup.exe NT SERVICE\TrustedInstaller:F
                               BUILTIN\Administrators:R
                               NT AUTHORITY\SYSTEM:R
                               BUILTIN\Users:R

C:\Windows\system32\ktmutil.exe NT SERVICE\TrustedInstaller:F
                                BUILTIN\Administrators:R
                                NT AUTHORITY\SYSTEM:R
                                BUILTIN\Users:R

Press any key to continue . . .


As you can see, there are actually four files name k*.exe in the SYSTEM32 directory, and the batch file can see and change them without problem. KiXtart only sees one of the four, and it does not appear to be unique in terms of attributes or file permissions.

If someone could shed some light on this issue, I would be most appreciative.

Top
#198027 - 2010-03-10 09:34 PM Re: KiXtart partially blind in Windows 7? [Re: groon]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
In the manual look for setoption() and then "Wow64FileRedirection".

Also see the following thread where this is discussed much further.

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Main=25296&Number=193024#Post193024

Top
#198030 - 2010-03-10 10:32 PM Thank you! [Re: Allen]
groon Offline
Just in Town

Registered: 2010-03-10
Posts: 4
Loc: Canada
Wow! (pun intended)

Thank you very much. For anyone who happens across this thread, the issue and solution can be seen by running the following very simple script:
 Code:
? "(Using KiXtart command to reset file attibutes)" ?
$rcode=setfileattr("%systemroot%\system32\kix32.exe",0)
@serror ?
? "Checking attributes of all k*.exe files from KiX:" ?
shell "cmd.exe /c attrib %systemroot%\system32\k*.exe"
? 
"Now turning off Wow64Fileredirection." ? ?
$rcode=setoption("Wow64FileRedirection","off")
? "(Using KiXtart command to set kix32.exe system hidden read-only)" ?
$rcode=setfileattr("%systemroot%\system32\kix32.exe",7)
@serror ?
? "Checking attributes of all k*.exe files from KiX:" ?
shell "cmd.exe /c attrib %systemroot%\system32\k*.exe"
? 
? "(Using KiXtart command to reset file attibutes)" ?
$rcode=setfileattr("%systemroot%\system32\kix32.exe",0)
@serror ?
? "Checking attributes of all k*.exe files from KiX:" ?
shell "cmd.exe /c attrib %systemroot%\system32\k*.exe"
? 

Note that if you run this on 32-bit Windows, there will be no change. On 64-bit Windows, file redirection and the use of setoption() to disable it is seen.

Thank you again!

Top
#198043 - 2010-03-11 10:07 PM Re: Thank you! [Re: groon]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Thank you for the follow-up reply.

Yes Vista/Win7 have made things a bit more difficult to do quick easy remote admin tasks like we've been so used to now for a decade in 2000/XP

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 557 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.056 seconds in which 0.028 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org