Shell command with parameters from RTC
sbs
Member Posts: 27
Hi
I want to call a shell command from RTC with parameters.
I found this thread
viewtopic.php?f=32&t=31440
But unforturnately I am using 2009 sp1, so dotnet is not an option
I want to call a shell command from RTC with parameters.
I found this thread
viewtopic.php?f=32&t=31440
But unforturnately I am using 2009 sp1, so dotnet is not an option
0
Answers
-
And why not to upgrade to NAV 2009R2? It is just another hotfix for SP1...0
-
Hi sbs,
Please try with below code.OBJECT Codeunit 55000 WshShellRun { OBJECT-PROPERTIES { Date=02/06/13; Time=10:23:58 PM; Modified=Yes; Version List=; } PROPERTIES { OnRun=BEGIN END; } CODE { PROCEDURE fnWshShellRun@1000000000(ptxtCommand@1000000002 : Text[1024];ptxtParameter@1000000004 : Text[1024];pintWindowStyle@1000000001 : Integer;pblnWaitOnReturn@1000000000 : Boolean); VAR WshShell@1000000003 : Automation "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{72C24DD5-D70A-438B-8A42-98424B88AFB8}:'Windows Script Host Object Model'.WshShell"; Text50000@1000000005 : TextConst 'ENU="""%1"" %2"'; BEGIN {=== How to Work cuWshShell.fnWshShellRun('C:\Program Files (x86)\Microsoft Dynamics NAV\60\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe', '/?',1,FALSE); } {=== object.Run(strCommand, [intWindowStyle], [bWaitOnReturn]) strCommand String value indicating the command line you want to run. You must include any parameters you want to pass to the executable file. intWindowStyle Integer value indicating the appearance of the program's window. Note that not all programs make use of this information. bWaitOnReturn Boolean value indicating whether the script should wait for the program to finish executing before continuing to the next statement in your script. If set to true, script execution halts until the program finishes, and Run returns any error code returned by the program. If set to false (the default), the Run method returns immediately after starting the program, automatically returning 0 (not to be interpreted as an error code). } {===WindowStyle Enumeration 0 Hides the window and activates another window. 1 Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time. 2 Activates the window and displays it as a minimized window. 3 Activates the window and displays it as a maximized window. 4 Displays a window in its most recent size and position. The active window remains active. 5 Activates the window and displays it in its current size and position. 6 Minimizes the specified window and activates the next top-level window in the Z order. 7 Displays the window as a minimized window. The active window remains active. 8 Displays the window in its current state. The active window remains active. 9 Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window. 10 Sets the show-state based on the state of the program that started the application. ====} CREATE(WshShell,FALSE,ISSERVICETIER); WshShell.Run(STRSUBSTNO(Text50000,ptxtCommand,ptxtParameter),pintWindowStyle,pblnWaitOnReturn); CLEAR(WshShell); END; BEGIN END. } }
Best Regards,
YukonMake Simple & Easy0
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
- 322 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
