[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2509.0. "Spcifying File containing " " in Shell Function" by TKOVOA::OTSUKA_Y ([email protected] ) Tue Mar 04 1997 00:37

Hello everyone,

I have some questions about long file name.

Questions:

   (1)   When using Shell function, 
         one can be able to specify : 
	     tid% = Shell ("Executable_Image_File  To_Be_Read_Data_File"  ,  n)
	 like this, 
	 starting up the .EXE file with mode reading the data file.

         However, if those files are not 8+3 format (long file name format) 
	 or containing spaces (which is allowed in the file system), 
	 VB returns an error message.

	 Error when the file specification containing space is understandable,
	 perhaps VB thinks the space as the clause delimitter.

	 How do I be able to specify those file in Shell Function ? 

	 I tried quoting those files, but all failed.

   (2)   Suppose the above question is tricky to solve...
	 Okay, I will go into an another way : 
	 How do I get short file name format (8+3 format) from an existing 
	 long file name ?

Any inputs are deeply appreciated.

Thank you in advance,
Yuichiro Ohtsuka
(Tokyo, Japan)
T.RTitleUserPersonal
Name
DateLines
2509.1Use API call ShellExecute insteadELIS::TOWERSTue Mar 04 1997 03:0010
    You might like to look at the ShellExecute function in the shell32.dll.
    This is what I usually use instead of Shell. Here is the declaration:
    
    Declare Function ShellExecute Lib "shell32.dll" _
      Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation _
      As String, ByVal lpFile As String, ByVal lpParameters As String, _
      ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    
    Cheers,
    Brian
2509.2thank you !TKOVOA::OTSUKA_Y[email protected] Tue Mar 04 1997 05:268
RE: #2509.1 (.-1) ;

Thank you, Brian-san !

Now the program seems working correctly.
This solved my problem.  Thank you.

/Yuichiro Ohtsuka