Solved

Microsoft Windows Server 2012 R2 Essentials: %SystemRoot%\Sysnative folder is missing

Posted on 2016-09-05
4
474 Views
Last Modified: 2016-09-13
Hello,

i need to start a 64bit Powershell from a 32bit process.
Normally i would use this statement to achieve this:

%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -Command "& 'ThatScriptThatNeeds64Bit.ps1'"

At least that is what i would normally do.

On that "Microsoft Windows Server 2012 R2 Essentials" Server on which I am working right now the sysnative folder / redirection is missing.

I have tried two options:
C:\Windows\syswow64\WindowsPowerShell\v1.0\powershell.exe and
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

In the context of my 32bit application both calls start a 32bit powershell process. (Tested using [Environment]::Is64BitProcess.) Thus i cannot access the 64bit Powershell Module that I need to access.

Can I like install that sysnative Folder somehow? Or does someone have an idea how to get that 64bit process started?

Thank you very much,
   Stefan
0
Comment
Question by:Stefan Hoffmann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 70

Assisted Solution

by:Qlemo
Qlemo earned 250 total points
ID: 41785213
Are you certain you cannot just use SysNative? How did you check?
Of course both other paths only lead to 32bit PowerShell.
0
 
LVL 84

Accepted Solution

by:
oBdA earned 250 total points
ID: 41785610
You'll only see the sysnative folder from a 32bit process, and even then, you'll have to know that it's there, as this is a feature of the WOW64 subsystem
So open a 32bit PS, and enter
gci C:\Windows\sysnative

Open in new window

Do you get a folder listing? If not, what is the error message?

What is the error message when you actually try to run your %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -Command "& 'ThatScriptThatNeeds64Bit.ps1'" command from a 32bit Powershell console?
Is maybe the execution policy (32bit and 64bit have separate execution policies!) preventing the script form starting?
0
 
LVL 1

Author Comment

by:Stefan Hoffmann
ID: 41785722
Thank you both very much for your answers. And for doubting me.

I opened a 32bit Powershell as requested and entered the requested command.
Which opened my eyes. Now, that I know that was my fault everything else fell into place and the problem is solved. Thank you very much, especially oBdA for being most helpful, and Qlemo too for doubting me. You were right.

The complete story behind this:

- there is a monitoring software that collects data, it can start batch files (32bit)
- there is a batch file (running as 32bit), that starts the powershell
- there is a powershell (needed as 64bit)

- the script is monitoring an important software and is called every 5 minutes

First problem:
Being downloaded to the computer from a web page it was flagged, so powershell didn't like the execution of the script much and asked "shall i really execute this?"...

Since the script is executed by a monitoring software, that question has been unanswered... thus powershells kept piling up, till the monitoring software sensed that something odd was happening and stopped the execution of the script

I found the problem with "shall I really execute this" relativly easy by trying to execute this. But of cause, i did this (by accident) in a 64bit cmd.

As I mentioned the script is called through a batch file. So i started the batch file. Which contains the line with the sysnative path. Which led to "path not found". Because, as has been said correctly, that directory cannot be seen from 64 bit processes.

From there on I went wrong.
As already said - I say it again - thank you very much! What a relief!
0
 
LVL 1

Author Closing Comment

by:Stefan Hoffmann
ID: 41796512
I see, somehow i did not close that question.
Bad me.
Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question