How are people handling batch files? The reason I ask is that I've been running into a lot of compatibility "issues" when trying to run my batch files via scripting, it'll fail. Yet if I manually run this SAME batch file from the KACE folder, it runs correctly.

This time, it probably has something to do with that I need to launch the 64-bit version of DISM not the 32-bit version.

 Any thoughts?

Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

3

I know this was answered a while back, but i have just found a simpler fix, for anyone else having this particular issue.

Instead of calling DISM or C:\Windows\System32\dism.exe from your batch file, use the path C:\Windows\Sysnative\dism.exe
This will call DISM from the 64 bit "System32" folder, rather than the Wow64 filesystem redirection for 32 bit processes.

All explained pretty well here: http://www.nynaeve.net/?p=133

Answered 10/08/2013 by: rjonesdj
Orange Belt

Please log in to comment

Answers

2

This may help. A Bat to Exe Converter:

http://download.cnet.com/Bat-To-Exe-Converter/3000-2069_4-10555897.html

It has an option to create a 64 bit exe. So I would take your bat file convert it to a 64 bit exe and then run it from the kbox and see if it works.

Answered 02/12/2013 by: darkhawktman
Green Belt

  • As well iexpress.exe is a program built into Windows that will allow you to convert batch to exectuable.

    Once you have the bat file created open the start menu and type iexpress.exe and hit enter.

    At the Welcome page click Next

    At the package purpose screen click Next

    Title the package and click Next

    Click Next on confirmation prompt (left on No Prompt)

    Click Next on License agreement (left on Do No Display a license).

    Click Add and navigate to the batchfile you created and click Next

    At Install Program to launch type cmd /c <batchname>.bat in Install Program and click Next

    Click Hidden on the Show Window page and click Next

    Click Next on Finished message (left on No Message)

    Browse to the shared location where you have the working files located and save the name netmap check Hide File extracting… and Store Files using Long… click Yes on the wizard’s warning and click Next.

    Click No Restart and click Next.

    Click Don’t Save on the Save SED page and click Next

    Click Next on create package.

    Click Finish and test <batchname>.exe
  • Turns out IExpress.exe was the trick. Good to know. Thanks.
Please log in to comment
1

I noticed when I launch "cmd.exe" it runs as a 64-bit process. But when KACE runs "cmd.exe" it runs as "cmd.exe *32" (a 32-bit process). I think this has something to do with it.

Answered 02/12/2013 by: afincher
Purple Belt

  • Kace is a 32 bit app. That shouldn't make a difference. Are all of your scripts failing? Can you share your setup on some of the ones that fail? Perhaps a screenshot?
    • Something like this might be helpful if your batch requires a 64 bit prompt: http://www.heckler.com.br/blog/2010/03/16/how-to-open-a-64bit-command-prompt-from-a-32bit-application/
      • @jknox good information to have. Thanks.
  • @dugullett: My KACE script was:
    On Success: Launch “$(KACE_DEPENDENCY_DIR)\EnableGames.bat†with params “â€

    the "EnableGames.bat" file is:
    dism.exe /online /enable-feature /featurename:InboxGames /NoRestart


    KACE would properly launch the BAT file, but DISM would throw the error because it was a 32bit command line launching it rather than the 64bit:
    You cannot service a running 64-bit operating system with a 32-bit version of DISM.
    Please use the version of DISM that corresponds to your computer's architecture.
Please log in to comment
0

Here is what i did for windows 8 : I have been working on this for a couple days because i was pushing out Dot net 3.5 sp1 that included 2 and 4 for windows 8 i found the instructions <a herf="http://social.technet.microsoft.com/Forums/en-US/1854791d-75cd-4d44-9b94-12065d033121/dotnet-35-sp1-on-windows-8?forum=w8itproappcompat"><Here</a>. I kept getting Error 11. I added a task of Launch program and pointed it to:

Directory: C:\Windows\WinSxS\amd64_microsoft-windows-d..ervicing-management_31bf3856ad364e35_6.2.9200.16384_none_b7734a7c9770a13d\

File: dism.exe

with Paramaters: /online /enable-feature /featurename:NetFX3 /All /Source:$(KACE_DEPENDENCY_DIR)\sxs /LimitAccess

 

Hope this helps someone else.

Answered 01/30/2014 by: kcolville
White Belt

Please log in to comment
0

By default everything runs as SYSTEM. Is your batch file something that requires local user access?

Answered 02/12/2013 by: dugullett
Red Belt

  • It should be ok running as SYSTEM. Just to verify, I attempted to run it with the local administrator account and I get the same result.
Please log in to comment
0

Please be also aware that not every system wide variable is resolved correctly, so use hard coded paths if possible or be shure the variables are known to the script.

Answered 02/13/2013 by: Nico_K
Red Belt

Please log in to comment
0

I ended up using samzeeco's solution of iexpress.exe

Thank you all.

Answered 02/13/2013 by: afincher
Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity