Page 1 of 1 1
Topic Options
#209607 - 2014-11-01 06:39 PM DIR not working on Windows 8.1 64-bit -- HELP!
JNK Offline
Fresh Scripter

Registered: 2006-04-11
Posts: 33
Loc: USA
I am working on a utility script to run Sysprep. I have a block of code that verifies %windir%\system32\sysprep\sysprep.exe exists and the DIR function is failing to 'see' some of the items.

On Win 8.1 64-bit ...

C:\>dir %windir%\system32\sysprep

Directory of C:\Windows\system32\sysprep

05/28/2014 09:59 PM <DIR> .
05/28/2014 09:59 PM <DIR> ..
10/20/2014 04:49 PM <DIR> ActionFiles
09/29/2013 11:50 PM <DIR> en-US
05/11/2014 01:22 AM <DIR> Panther
02/22/2014 06:46 AM 432,640 sysprep.exe
08/22/2013 07:02 AM 991,744 unbcl.dll

If I run the following Kix ...

 Code:
$filename = dir("%windir%\system32\sysprep")
while $filename <> "" and @error = 0
  $filename ?
  $filename = dir()
loop


... Kix only displays three items: root, parent and \en-US.

.
..
en-US


I tried to add the following to the top of the script ... no joy.

if @onwow64
$x = setoption("wow64fileredirection","on")
$x = setoption("wow64alternateregview","on")
else
$x = setoption("wow64fileredirection","off")
$x = setoption("wow64alternateregview","off")
endif

If I go up one folder level and dir %windir%\system32, I get accurate results. What is so special about the \Sysprep folder that Kix cannot see everything in there??

<confused>

Top
#209608 - 2014-11-01 07:35 PM Re: DIR not working on Windows 8.1 64-bit -- HELP! [Re: JNK]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
$RC=setoption("Wow64FileRedirection","off")

If an OS is 64bit Wow64FileRedirection is ON by default. For a 32 bit process (which kix is), you need to turn it off to see the files.
_________________________
(... better days ahead)

Top
#209613 - 2014-11-02 11:57 PM Re: DIR not working on Windows 8.1 64-bit -- HELP! [Re: Allen]
JNK Offline
Fresh Scripter

Registered: 2006-04-11
Posts: 33
Loc: USA
<bangs head of desk>



I knew it was going to be something really simple/stupid. It was right in front of me the whole time. I should know better than to write scripts when I am sleep-deprived.

... still doesn't explain why it could see the .\en-US folder but nothing else but not going to worry about it at this point. Setting for correct option worked. Of course it did!

Thx, Allen, for setting me straight.

~JNK

Top
#209614 - 2014-11-03 02:14 AM Re: DIR not working on Windows 8.1 64-bit -- HELP! [Re: JNK]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
_________________________
(... better days ahead)

Top
Page 1 of 1 1


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

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.237 seconds in which 0.087 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