Run Windows Fax And Picture Viewer using Shell Command

doddwell
Member Posts: 65
Hello
I have a number of scanned .TIff Images that I woudl like the user to be able to open inside MS Windows fax And Picture Viewer. I have tried the HYPERLINK function but this does not work for me....so I am trying to get the SHELL function to do the trick. I can get the Shell function to work iff I try and open a text file in Notepad but I cant get the Windows Fax and Picture Viewer to run. This is my code:
ExecName := 'RunDLL32.exe C:\Windows\System32\Shimgvw.dll';
param := 'C:\Test.tif';
ret1 := SHELL(ExecName, param);
I get the following error:
The file name "RunDLL32.exe C:\Windows\System32\Shimgvw.dll" contains and invalid character that may not be used.
Any ideas? Thankyou
I have a number of scanned .TIff Images that I woudl like the user to be able to open inside MS Windows fax And Picture Viewer. I have tried the HYPERLINK function but this does not work for me....so I am trying to get the SHELL function to do the trick. I can get the Shell function to work iff I try and open a text file in Notepad but I cant get the Windows Fax and Picture Viewer to run. This is my code:
ExecName := 'RunDLL32.exe C:\Windows\System32\Shimgvw.dll';
param := 'C:\Test.tif';
ret1 := SHELL(ExecName, param);
I get the following error:
The file name "RunDLL32.exe C:\Windows\System32\Shimgvw.dll" contains and invalid character that may not be used.
Any ideas? Thankyou
0
Comments
-
Guess.. in the execname there is a parameter too.0
-
I tried splitting it as you impied like this:
ExecName := 'RunDLL32.exe';
param := C:\Windows\System32\Shimgvw.dll'
param1 := 'C:\Test.tif';
ret1 := SHELL(ExecName, param, param1);
But I get the error message "The operating system cannot find the file rundll32.exe"
I have also tried substituting the space for an ASCII Charecter but can't concatenate a String with a Char so had to do this:
spaceAscii = 13;
ExecName := 'RunDLL32.exe' + FORMAT(spaceAscii) + 'C:\Windows\System32\Shimgvw.dll'
param1 := 'C:\Test.tif';
ret1 := SHELL(ExecName, param, param1);
I end up with the same error in my original post:
The file name "RunDLL32.exe C:\Windows\System32\Shimgvw.dll" contains and invalid character that may not be used.
Many Thanks.0 -
What command do you run in a DOS box, or Run ?0
-
This is what I enter into Run: (and it works):
rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen C:\Test.tif
Note - my earlier code snippet was missing the ImageView parameter. Actual code used is;
ExecName := 'rundll32.exe C:\WINDOWS\System32\shimgvw.dll';
param1 := 'ImageView_Fullscreen';
param2 := 'C:\Test.tif';
ret1 := SHELL(ExecName, param1, param2);
I don't think it likes the space in ExecName.
Thanks.0 -
From the helpfile on Shell : "The parameters cannot be passed as part of the Name parameter. The Name parameter must be filled in and it must not contain any parameters except for the executable." the executable here is RunDLL32.exe, and the DLL to run is a parameter it takes.
So try :
Execname : 'RunDLL32.exe'
Param : 'C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen'
param1 : 'C:\Test.tif'0 -
//GaWshShell, Automation, 'Windows Script Host Object Model'.WshShell
IF ISCLEAR(GaWshShell) THEN BEGIN
//MOD_NAV6.0
IF ISCLEAR(GaWshShell) THEN CREATE(GaWshShell, TRUE, TRUE);
//MOD_NAV5.0
IF ISCLEAR(GaWshShell) THEN CREATE(GaWshShell, TRUE);
END;
LiValue := 1;
LbValue := FALSE; //Wait until finished
GaWshShell.Run('rundll32 C:\WINDOWS\System32\shimgvw.dll, ImageView_Fullscreen C:\capture.png', LiValue, LbValue);0 -
Hi ,
Please try with below sample code. Specially it not so much different with MBerger's sample. Or if you want to use "Windows Script Host Object Model", you can follow by mdPartnerNL's sample.{====Variable ExeName Text 1024 ExeParameter Text 1024 PictureName Text 1024 } ExeName := 'C:\windows\system32\RunDLL32.exe'; //i set path of "RunDll32.exe". ExeParameter := 'C:\Windows\System32\Shimgvw.dll,ImageView_Fullscreen'; PictureName := 'C:\avatar1_3.GIF'; SHELL(ExeName,ExeParameter,PictureName); //SHELL('C:\windows\system32\RunDLL32.exe','C:\Windows\System32\Shimgvw.dll,ImageView_Fullscreen','C:\avatar1_3.GIF');
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
- 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