Working method to call external script on 64-bit Windows

ullerdk
Member Posts: 16
Hi everybody.
Does anybody know a working method to call/execute a external script on a Windows 64-bit computer? The normal Wshell command doesn't seem to work.
Regards
Ulrik
Does anybody know a working method to call/execute a external script on a Windows 64-bit computer? The normal Wshell command doesn't seem to work.
Regards
Ulrik
0
Comments
-
I just tried WSHShell.Run and WSHShell.Popup on Server 2003, 64Bit and both work.
What exactly is your problem? Maybe it is not a question of 64 Bit but of the OS version?Frank Dickschat
FD Consulting0 -
I am not a programmer myself, but I can see that the command Wshell.Run that the programmer has used to call the external script, isn't valid and understood by the DOS shell on a Windows 7 64-bit. I tried on Windows 7 32-bit, there it works fine.
Which automation did you use?0 -
The Automation is 'Windows Script Host Object Model'.WshShell. We typically use Run, Popup and the Registry functions.
As you stated in your case it is a windows 7, 64Bit problem. It seems not to be a general 64Bit problem as there is no problem here with Server2003 64Bit.
http://en.wikipedia.org/wiki/Windows_Script_Host lists Windows 7 with WSH 5.7 so it should exist on your OS. Maybe it is deactivated. Google how to lookup whether that is the case.Frank Dickschat
FD Consulting0 -
FDickschat wrote:The Automation is 'Windows Script Host Object Model'.WshShell. We typically use Run, Popup and the Registry functions.
As you stated in your case it is a windows 7, 64Bit problem. It seems not to be a general 64Bit problem as there is no problem here with Server2003 64Bit.
OK, have you tested now yourself on a 64-bit Windows 7 and it didn't work?0 -
No, I have here only several W7 32Bit Computers available. Maybe you should change the topic so that someone who reads this thread knows what you are looking for.Frank Dickschat
FD Consulting0 -
Is it possible to specify which version (32/64 bit) of WSH to use in the code? Fx. C:\Windows\SysWow64\wscript.exe for the 32-bit WSH on a Windows 64-bit edition ?0
-
Well, what I want to accomplish here, is to send a lpr.exe command to a printer.
Right now it works on a 32-bit Windows, by calling a cmd-file containing the lpr command.
When trying on a 64-bit Windows, what happens is, that a 32-bit command shell is opened and since the lpr.exe does not exist as a 32-bit file in either c:\windows\system32 or c:\windows\syswow32, the file is not found. Even a "dir lpr*" command in a 32-bit command prompt does NOT list the lpr.exe file. So 64-bit files are not seen by a 32-bit command shell.
So now I ask: is it possible to execute a 64-bit command shell from the 32-bit Dynamics NAV application and of course still maintain full compability with the same function on a 32-bit Windows computer?0 -
5 Minutes Googling and it seems you are not the only one:
If you can not find lpr.exe at all on your machine you will need to reinstall it. It should be in %windir%\system32.
In a newsgroup I found this (in german): http://www.ureader.de/msg/12428182.aspxFrank Dickschat
FD Consulting0 -
Hi Frank.
I have already added the LPR print function through "Windows components", but as I tried to explain in my former post, LPR.exe is a 64-bit DOS application, which is NOT accessible in a 32-bit command prompt (c:\windows\syswow64\cmd.exe).
You can try this on a Windows 7 64-bit computer:
1. Install LPR print feature through the "Windows components"
2. Start c:\windows\syswow64\cmd.exe, which is the 32-bit command prompt
3. Execute the command "dir c:\windows\system32\lpr*" which will show no files.
4. Exit the command prompt
5. Start the normal 64-bit command prompt (through start/accessories)
6. Execute the command "dir c:\windows\system32\lpr*" which will now show lpr.exe file
LPR.exe only exists in c:\windows\system32\ as a 64-bit file, and when calling external scripts from Dynamics NAV, it is obviously the 32-bit command prompt that is started, since Dynamics NAV is a 32-bit application.0 -
Would it be possible to copy the old 32 bit lpr.exe from an xp machine? Will that work under W7?Frank Dickschat
FD Consulting0 -
FDickschat wrote:Would it be possible to copy the old 32 bit lpr.exe from an xp machine? Will that work under W7?
Great idea. I will try to copy lpr.exe from a 32-bit Windows 7 to the c:\windows\syswow64 folder on the Windows 7 64-bit computer.0 -
ullerdk wrote:FDickschat wrote:Would it be possible to copy the old 32 bit lpr.exe from an xp machine? Will that work under W7?
Great idea. I will try to copy lpr.exe from a 32-bit Windows 7 to the c:\windows\syswow64 folder on the Windows 7 64-bit computer.
YES, it worked! Thanks for the suggestion.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions