none
Script to disable 64-bit file system redirection

    Soru

  • I am trying to run some scripts through SCCM 2007 on Windows 7 x64 machines.

    When I test the scripts using psexec -s cmd to start a command prompt with the system account they work fine. If I start a command prompt through SCCM then they don't work. The reason is that the SCCM client is a 32bit application, so file system redirection is automatically changing the paths from %Windir%/system32  to %Windir%/syswow64.

    I have been able to make the scripts work through SCCM by running them as a task sequence, and checking "Disable 64-bit file system redirection", but I would prefer to do this directly in the script.

    Anyone know a way of doing this?

    31 Ocak 2012 Salı 11:49

Yanıtlar

  • Hi,

    I thought I should update this with the solution I used in the end.

    The file I was trying to run was called manage-bde.exe is under C:\Windows\System32.

    When I try to run it through SCCM it didn't work, as the SCCM client is a 32 bit app, and C\Windows\System32 gets redirected to C:\Windows\SYSWOW64, and manage-bde.exe is not at the location.

    To fix I needed to run the command   as    "%windir%\sysnative\Manage-BDE.exe"     

    32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access
    http://msdn.microsoft.com/en-us/library/aa384187(v=vs.85).aspx

    • Yanıt Olarak İşaretleyen JohnnyGe 19 Mart 2012 Pazartesi 08:47
    19 Mart 2012 Pazartesi 08:47

Tüm Yanıtlar

  • are you saying that you're hard coding %windir%\system32 and you can see (in some log, etc.) that it is referencing %windir%\syswow64?  can you provide more details and/or a code snippet?
    31 Ocak 2012 Salı 14:21
  • If I start a command prompt through SCCM then they don't work. The reason is that the SCCM client is a 32bit application, so file system redirection is automatically changing the paths from %Windir%/system32  to %Windir%/syswow64.

    Hi,

    First of all, this is what is supposed to happen with the WOW64 emulator. On 64-bit Windows, 32-bit programs run in an emulation layer, and if you don't like that, then don't use the emulator (from that blog entry, "It is better to work with the system than against it").

    Secondly, you say it doesn't work. When you say that something doesn't work, you have to say how it doesn't work.

    Bill

    31 Ocak 2012 Salı 15:16
    Moderatör
  • I am trying to run some scripts through SCCM 2007 on Windows 7 x64 machines.

    When I test the scripts using psexec -s cmd to start a command prompt with the system account they work fine. If I start a command prompt through SCCM then they don't work. The reason is that the SCCM client is a 32bit application, so file system redirection is automatically changing the paths from %Windir%/system32  to %Windir%/syswow64.

    I have been able to make the scripts work through SCCM by running them as a task sequence, and checking "Disable 64-bit file system redirection", but I would prefer to do this directly in the script.

    Anyone know a way of doing this?


    It does not make sense to run a remote script and use PsExec inside the script.  PsExec is a remoting utility.

    Why would you want to start a remote command prompt?  Do you mean you want to execute a remote batch file?  Just call the batch file without PsExec.

    To obtain the script session properties reference the SCCM object that is habded into the script.  See the SCCM scripting samples in teh installation folder or on the SCCM web site.

    If you are executing the script on the SCCM computer then you cannot likely change teh session architecture from within the script session.  This would not make any sense.

    I recommend starting here to get a better understanding of how SCCM works and how it is intended to be used.  It will save you a lot of wasted time.

    System-Center-Operations-Manager-2012-Part1

     


    jv
    31 Ocak 2012 Salı 19:04
  • Thanks for your replies.

    One of the things I am trying to do is to backup Bitlocker recovery keys to AD through SCCM using the command manage-bde.exe. This is a 64 bit application and is found under %Windir%/system32.

    A method I have used to test scripts before publishing them in SCCM is to start a command prompt with the local system account using psexec.exe -s cmd Running the manage-bde command works fine like this. However, if I try and run manage-bde.exe command through SCCM it fails, as it doesn't find the manage-bde.exe file.

    This is because its a 64bit app and resides at %Windir%/system32. The SCCM client is a 32bit application, so when it tries to run an .exe file under %Windir%/system32 it is automatically redirected to %Windir%/syswow64, and the manage-bde.exe file doesn't exist in this location. I understand this and expect it to happen, but it doesn't help me when backing up Bitlocker keys. 

    So my workaround is to use an SCCM task sequence, where I have the option to "Disable 64-bit file system redirection"
    http://www.windows-noob.com/forums/uploads/monthly_11_2008/post-1-1228046062.jpg  (screenshot is just to show the Disable redirection setting)

    Then the script is able to access the files in %Windir%/system32 without redirection, and it works.

    I don't really like using a Task Sequence, which is why I am trying to find a way of doing it from a bat file, vbscript  etc.

     


    • Düzenleyen JohnnyGe 01 Şubat 2012 Çarşamba 08:30
    01 Şubat 2012 Çarşamba 08:25
  • Why are you using a 32 bit client on a 64 bit machine?

    Why sisable 64 bit support when you need a 64 bit session.

    None of this makes much sense to me.

    Yu cannot change the session from a batch file or a script.  You can call into the other arcitecture.  Run cscript or CMD from the SysWow64 or from system32 depending on which version you need.

     


    jv
    • Düzenleyen jrv 01 Şubat 2012 Çarşamba 14:11
    01 Şubat 2012 Çarşamba 10:27
  • SCCM client is only available in 32bit.
    01 Şubat 2012 Çarşamba 10:39
  • SCCM client is only available in 32bit.


    You are not running 2012?

    What I posted still counts if running on a 64 bit platform.

     


    jv
    • Düzenleyen jrv 01 Şubat 2012 Çarşamba 14:12
    01 Şubat 2012 Çarşamba 14:11
  • As I said in the first line of my first post, I am running SCCM 2007 and unfortunatley there isn't a 64bit client for sccm 2007.

    I have a workaround for my problem, which is to disable the redirection through a task sequence. I was hoping that someone might know a way to do this from a script.

    The Task Sequence method works, so I will just use that.

     

     

     

    • Yanıt Olarak İşaretleyen JohnnyGe 02 Şubat 2012 Perşembe 07:15
    • Yanıt İşaretini Geri Alan JohnnyGe 19 Mart 2012 Pazartesi 08:37
    • Yanıt Olarak İşaretleyen JohnnyGe 19 Mart 2012 Pazartesi 08:47
    • Yanıt İşaretini Geri Alan JohnnyGe 19 Mart 2012 Pazartesi 08:47
    02 Şubat 2012 Perşembe 07:14
  • Hi,

    I thought I should update this with the solution I used in the end.

    The file I was trying to run was called manage-bde.exe is under C:\Windows\System32.

    When I try to run it through SCCM it didn't work, as the SCCM client is a 32 bit app, and C\Windows\System32 gets redirected to C:\Windows\SYSWOW64, and manage-bde.exe is not at the location.

    To fix I needed to run the command   as    "%windir%\sysnative\Manage-BDE.exe"     

    32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access
    http://msdn.microsoft.com/en-us/library/aa384187(v=vs.85).aspx

    • Yanıt Olarak İşaretleyen JohnnyGe 19 Mart 2012 Pazartesi 08:47
    19 Mart 2012 Pazartesi 08:47
  • Hi,

    I thought I should update this with the solution I used in the end.

    The file I was trying to run was called manage-bde.exe is under C:\Windows\System32.

    When I try to run it through SCCM it didn't work, as the SCCM client is a 32 bit app, and C\Windows\System32 gets redirected to C:\Windows\SYSWOW64, and manage-bde.exe is not at the location.

    To fix I needed to run the command   as    "%windir%\sysnative\Manage-BDE.exe"     

    32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access
    http://msdn.microsoft.com/en-us/library/aa384187(v=vs.85).aspx

    Yes - your more comlete ex0planation of what you are trying to do makes this the best solution however it will not work on systems pre-Vista so be careful.

    The new System center is in beta.  I expect it now has a true native client for 64bits.


    ¯\_(ツ)_/¯

    19 Mart 2012 Pazartesi 17:42
  • I have been looking for this solution for over 2 weeks. Your answer just solved my issue! 

    THANK YOU!!!!

    07 Mayıs 2012 Pazartesi 13:39
  • Hi jrv,

    Your explanation is superb and is recommended.

    Thanks a ton. :)

    Sai.

    07 Aralık 2012 Cuma 19:26
  • Thanks for the very helpful tip!
    10 Temmuz 2013 Çarşamba 15:42