SYS_DIR variable and Windows XP x64

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
observer
Junior Coder
Posts: 44
Joined: Tue Aug 18, 2009 7:55 pm

SYS_DIR variable and Windows XP x64

Post by observer » Wed Oct 28, 2009 11:03 pm

Hi,
SYS_DIR variable's behaviour is really strange under Windows XP x64.
This variable is presented as C:\Windows\system32 if Let, MessageModal commands are used. But it equals C:\WINDOWS\SysWOW64 if WriteLn, ReadLn, ReadFile, ExportData commands are used.
Just run the code below under Windows XP x64.

Code: Select all

Let>Path=%SYS_DIR%
MDL>%Path%
MDL>%SYS_DIR%
// Don't try to find the file below (SysDir_TEST.txt) in C:\Windows\system32 directory. It will be created in C:\WINDOWS\SysWOW64 directory!
WriteLn>%SYS_DIR%\SysDir_TEST.txt,nWLNRes,Is the current directory %SYS_DIR%?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Oct 29, 2009 9:34 am

SYS_DIR is initialised and set only once at the start of the script and is never modified later.

We use the Windows API function GetSystemDirectory to retrieve it:

http://msdn.microsoft.com/en-us/library ... S.85).aspx

I think the reason files are being written to SysWOW64 is because that's the 32 bit system folder. Macro Scheduler is a 32 bit app. So while C:\Windows\System32 is the main system folder, Macro Scheduler can only read/write to SysWOW64. Sounds counter intuitive I know but that's the way Microsoft made it:

http://discuss.joelonsoftware.com/defau ... .537481.11

As noted in another thread recently a 64 bit version of Macro Scheduler is intended but has been set back because the 64 bit version of the compiler we use to create Macro Scheduler has been delayed.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts