Exescript 3 3 7 0
Anyone have any tricks up their sleeve to do as the title says? For example:I'm working within a 32bit app that calls a command using cmd.exe.
In taskmanager we see cmd.exe.32From that cmd.exe, say we want to launch notepad.exe. Obviously taskmanager will show notepad.exe.32. We want plain old 'notepad.exe' running in 64bit mode.Thoughts:I've been unable to do this using vbscript and may try a.NET console application next.Another thought is to set up a schtask, run it, then delete it.but that sounds messy.Am I missing something that would make this extremely easy? Well, I'm working within WiseScript Editor and SMS Installer. They are 32bit compiled scripting languages so, if I launch notepad.exe from within the compiled Wise or SMS Installer scripts, using either their built-in Execute Program command the OSalways launches the process as a 32bit process as the parent process is 32bit even when trying to specify notepad.exe in%WINDIR%system32.I did, however, find a solution using vb.net. I compiled the following code as a console app named cmdx64.exeModule Module1Sub MainDim arrArgs As ArrayDim Args As String = 'Dim intCount As Integer = 0arrArgs = System.Environment.GetCommandLineArgsFor Each Arg In arrArgsIf intCount 0 Then Args = Args & ' ' & ArgintCount = intCount + 1NextShell('cmd.exe /C' & Args, AppWinStyle.NormalFocus, True)End SubEnd ModuleNow when I run 'cmdx64.exe notepad.exe' from within WiseScript Editor and SMS Installer instead of getting notepad.exe.32 I now get the 64bit flavor.

So.I guess I answered my own question but it required a custom console command. I was hopingfor a native solution. I'm working within a 32bit app that calls a command using cmd.exe. In taskmanager we see cmd.exe.32From that cmd.exe, say we want to launch notepad.exe. Obviously taskmanager will show notepad.exe.32. We want plain old 'notepad.exe' running in 64bit mode.I observe different results. Here is what I tried on my Windows 7 machine:- Click Start / Search- Type this command: timethis.exe cmd /c d:test.vbs(timethis.exe is a 32-bit application)This gave me the following:- a 32-bit instance of cmd.exe- a 32-bit instance of cscript.exe- a 64-bit instance of iexplore.exed:test.vbsSet oWshShell = CreateObject('WScript.Shell')sCmd = 'cmd.exe /c 'c:Program FilesInternet ExplorerIExplore.exe'owshshell.Exec sCmdmsgbox 'Running IE 64-bit'.
Exescript 3 3 7 00
Well, I'm working within WiseScript Editor and SMS Installer. They are 32bit compiled scripting languages so, if I launch notepad.exe from within the compiled Wise or SMS Installer scripts, using either their built-in Execute Program command the OSalways launches the process as a 32bit process as the parent process is 32bit even when trying to specify notepad.exe in%WINDIR%system32.I did, however, find a solution using vb.net. I compiled the following code as a console app named cmdx64.exeModule Module1Sub MainDim arrArgs As ArrayDim Args As String = 'Dim intCount As Integer = 0arrArgs = System.Environment.GetCommandLineArgsFor Each Arg In arrArgsIf intCount 0 Then Args = Args & ' ' & ArgintCount = intCount + 1NextShell('cmd.exe /C' & Args, AppWinStyle.NormalFocus, True)End SubEnd ModuleNow when I run 'cmdx64.exe notepad.exe' from within WiseScript Editor and SMS Installer instead of getting notepad.exe.32 I now get the 64bit flavor. So.I guess I answered my own question but it required a custom console command. I was hopingfor a native solution.
When you run the 'Execute Program' function in SMS Installer and WiseScript youonly get 32bit processes. Even specifying%WINDIR%system32cmd.exe on a Win7 x64 box, both SMS Installer and WiseScript only opens a cmd.exe.32. The root of the problem is 1) SMS Installer is 32bit only and is nolonger supported, and 2) Altiris seems to have no intention of making their WiseScript Editor 64bit compliant.Our application deployment process leans heavily on the usage of WiseScript Editor for quickly automating the deployment and configuration of applications and the OS. With Win7 x64 on the horizon we need to start making changes, thatsfor sure, but at least now we can still use WiseScript in the interim.Why exactly does it work? I'm not entirely sure as I dont really know how those scripting engines execute programs. What I do know is that the x64 OS redirects everything to the x86 locations when using WiseScript. At least now if we installa 64bit application and then need to configure an INI or registry key for that application we can do so using that 64bit console app I wrote in the WiseScript 'Execute Program' function.
Otherwise, our WiseScripts would onlyhave access to the WOW6432node, Program Files (x86), and other similar locations that 32bit apps get redirected to. I must have not explained my original question correctly. The problem was this:1) From the run box execute:%WINDIR%sysWOW64cmd.exe /K2) Note that this console is running in taskmanager as cmd.exe.32.3) From this 32bit console start notepad.exe in 64bit mode by specifying the 64bit location:%WINDIR%system32notepad.exe4) Step 3 fails to launch notepad in 64bit mode. Notepad runs as notepad.exe.32 even tho we specified the 64bit location of notepad.This is expected behavior as the 64bit OS tries to sandbox 32bit applications. I need a way out of this sandbox while using some 32bit scripting engines such as WiseScript and SMS Installer. The 64bit console app I marked asan answer somehow gets me out of this 32bit sandbox when used in WiseScript and SMS Installer.If there is any other way to get out of this 32bit sandbox, such as opening a 64bit console using a vbscript launched from%WINDIR%sysWOW64cscript.exe, then that would be great.
3) From this 32bit console start notepad.exe in 64bit mode by specifying the 64bit location:%WINDIR%system32notepad.exeTry fc.exe /b in order to compare what you think are the 32-bit and 64-bit versions of notepad.exe. They look identical to me. This suggests that notepad.exe can run in 64-bit or in 32-bit mode, depending on how it gets invoked. If you invoked a true 64-bitprogram such as IExplore.exe then you would get what you expect, which is what I tried to demonstrate in the code I posted earlier. Try fc.exe /b in order to compare what you think are the 32-bit and 64-bit versions of notepad.exe. They look identical to me.
This suggests that notepad.exe can run in 64-bit or in 32-bit mode, depending on how it gets invoked. If you invoked atrue 64-bit program such as IExplore.exe then you would get what you expect, which is what I tried to demonstrate in the code I posted earlier.That is odd.I don't see that at all on my Windows 7 x64 machine.are you sure about that?C:dir C:WindowsSystem32notepad.exeVolume in drive C has no label.Directory of C:WindowsSystem32 06:39 PM 193,536 notepad.exe1 File(s) 193,536 bytesC:dir C:WindowsSysWOW64notepad.exeVolume in drive C has no label.Directory of C:WindowsSysWOW64 06:14 PM 179,712 notepad.exe1 File(s) 179,712 bytesBill. I am also looking for a solution to a very similar problem.
If you are in 32-bit command shell (not necessarily cmd.exe, thats part of the problem!) and you can not easily switch to a 64-bit version, but you need to launch a 64-bit console application, howcan you do that?Just trying to run it, gets you: 'This version of C:P.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and thencontact the software publisher.' I see that you can run a 32-bit console application fine under a 64-bit command shell, but not the other way around.I did think you could be clever and shell out to the 64-bit version of cmd.exe and pass it a command line argument, but of course Windows hides the 64-bit cmd.exe from a 32-bit command shell. Dir cmd.exe /s etc. Will not find it.The must be some clever little way.
Some clever way of invoking shellexecute or getting the desktop manager to execute a cmd.exe /xxx for you which would get you the 64-bit version of it? I was looking for this as well!Our issue is we use an old x86 program for login scripts, and one of the test scripts is to kill explorer.exe and restart it to refresh a background image. Not pretty, but it works. With the 32bit cmd it opens windows explorer instead of theactual explorer process. Using the%systemroot%sysnativecmd.exe /c explorer.exe allowed it to open the x64 explorer.
This is just on our test lab but it was frustrating first figuring out what it was doing, and then finding a solution that didn'tinvolve a complex script.
Features: Converts batch files, Visual Basic and Java scripts into executable files (exe format). Protects contents of.bat,.vbs,.js files from modification by other users. Contents of generated executables are hidden. The operations performed by converted batch files, Visual Basic and Java scripts can remain secret. Users without programming languages can create their own executable programs (exe files). Supports 'silent mode' - batch files execute invisibly, their launch can be invisible to other users.
Encrypts file contents. Script Type - it is possible to specify the script type - windowed or console. Command Line - the command line running the script. Executing the script in computer memory without writing to the disk. Therefore, the security of the script is enhanced since it is impossible to see the contents.
Password-protected launch of the compiled script. You can set a password for running the script converted into an exe application.
The new built-in file editor for.bat,.vbs,.js files has syntax highlighting. ExeScript is ideal for automating many of the routine chores that must be carried out when working with computers. Helps you create installation packages for the deployment of modules and programs. Converts any.bat,.vbs and.js files into exe files.