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
0
Comments
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.
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.
So try :
Execname : 'RunDLL32.exe'
Param : 'C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen'
param1 : 'C:\Test.tif'
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);
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.
Best Regards,
Yukon