locked
Windows 7 64 - Running a 32-bit Application with Processor Affinity RRS feed

  • Question

  • I'm using the following to start a 32-bit application with processor 1 affinity

    cmd.exe /c start "app name" /d "c:\app folder" /high /affinity 1 "c:\app folder\app.exe"

    This generates an error that the application cannot find a file under C:\Program Files (x86)\Common Files. I can solve this problem by adding the specific folder that contains the missing file to the PATH environment variable. However there may be other files in sub-folders that are needed so I don't think this is a good solution.

    I thought maybe the program was in 64-bit mode because I was running it from 64-bit cmd.exe and was therefore looking for the files in C:\Program Files\Common Files so I did the following:

    %windir%\SysWoW64\cmd.exe /c start "app name" /d "c:\app folder" /high /affinity 1 "c:\app folder\app.exe"

    However, that did not solve the problem of the missing file.

    I'd appreciate any suggestions. Thanks.

    Monday, August 27, 2012 10:58 PM

Answers

  • The application, when it runs successfully, adds both it's own EXE folder and this common files sub-folder to the start of the PATH environment variable. I was able to verify this because the application includes VBA and I wrote a small subroutine to list all environment variables.

    When the application is started with any method that sets affinity it is not able to do this. I verified this by adding the common files sub-folder at the end of the path which permits the application to run with the affinity method. If I do that the application runs but nothing is added to the front of the PATH environment.

    So why does the following prevent the application from modifying the PATH environment variable?

    cmd.exe /c start "app name" /d "c:\app folder" /high /affinity 1 "c:\app folder\app.exe"

    • Marked as answer by GTVic Monday, September 3, 2012 3:45 AM
    Tuesday, August 28, 2012 10:11 PM

All replies

  • Hi,

    What is the exact error message?

    Based on my test, I can make an application start properly via this method, I suspect this may be related to the specific software, could you run it properly in normal situation?

    Alex Zhao

    TechNet Subscriber Support

    If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.


    Alex Zhao

    TechNet Community Support

    Tuesday, August 28, 2012 7:23 AM
  • It just says it can't find a DLL file that is required and to check your installation. So yes it is this particular program with a custom error dialog. So the exact message is not important just that its normal search is skipping the folder where the file is located. I ran process explorer and under normal use the program checks 3 or 4 locations for this file and then finds it. When starting via this method it checks the same 3 or 4 locations, skips checking the folder under Program Files (x86)\Common Files and tries to find it in a half dozen other places and then gives up. Thx

    Tuesday, August 28, 2012 4:55 PM
  • The application, when it runs successfully, adds both it's own EXE folder and this common files sub-folder to the start of the PATH environment variable. I was able to verify this because the application includes VBA and I wrote a small subroutine to list all environment variables.

    When the application is started with any method that sets affinity it is not able to do this. I verified this by adding the common files sub-folder at the end of the path which permits the application to run with the affinity method. If I do that the application runs but nothing is added to the front of the PATH environment.

    So why does the following prevent the application from modifying the PATH environment variable?

    cmd.exe /c start "app name" /d "c:\app folder" /high /affinity 1 "c:\app folder\app.exe"

    • Marked as answer by GTVic Monday, September 3, 2012 3:45 AM
    Tuesday, August 28, 2012 10:11 PM
  • Hi, 

    Could you please provide the screenshot for the error message since it could not be reproduced in my local test? Thanks. 

    Kevin Ni


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, August 29, 2012 10:25 AM
  • Thanks for looking into this.

    I have attached the image to this message. I don't believe that will be helpful though as it is a custom application error message. Under normal operation the application is able to modify the PATH environment variable within its own runtime environment. When starting via the "cmd.exe start" method it is unable to do this.

    I have verified that this is the problem. I can solve the problem by manually creating a proper PATH environment in a CMD file before launching the application via "cmd.exe start". I'm guessing that CMD.EXE own's the environment and the application is a child process and doesn't have permission to modify it whereas when the application is launched on its own it is able to modify the environment. Hopefully there are no other side effects of this method of launching the process.

    What would be nice is an addition to the compatibility tab to allow processor affinity to be set without using CMD.EXE.

    Thursday, August 30, 2012 1:46 AM
  • Hi, Please try following suggestions: 1. Download the dll file:http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=4785107&linkID=9240618 2. Clean boot:http://support.microsoft.com/kb/929135 Thanks. Kevin Ni

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, August 31, 2012 10:08 AM
  • The file is not missing and it does not need to be updated. The clean boot is a technique for troubleshooting a problem. I know what the problem is and I am looking for an explanation or better method, otherwise I have a workaround (listed in previous post) that I am testing. Thx
    Monday, September 3, 2012 3:47 AM