|
-
April 8th, 2007, 05:39 AM
#1
problem with the spacing in the path
The code bellow executes well:
C:\mplayer\mencoder.exe -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames " & C:\mplayer\Max.mpg & " -o " & C:\mplayer\Max.flv & " -of lavf -ovc lavc -oac lavc -lavcopts vcodec=flv:vbitrate=500:autoaspect:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 redia=2 ia=2 recmp=2:cmp=2:subcmp=2 reme=2:turbo:acodec=mp3:abitrate=56 -srate 22050 -af lavcresample=22050
However the code bellow does not get executed:
C:\Documents and Settings\Eugene\Desktop\mplayer\mencoder.exe -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames " & C:\Documents and Settings\Eugene\Desktop\mplayer\Max.mpg & " -o " & C:\Documents and Settings\Eugene\Desktop\mplayer\Max.flv & " -of lavf -ovc lavc -oac lavc -lavcopts vcodec=flv:vbitrate=500:autoaspect:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 redia=2 ia=2 recmp=2:cmp=2:subcmp=2 reme=2:turbo:acodec=mp3:abitrate=56 -srate 22050 -af lavcresample=22050
I believe its because of the spacing or gap in the path such as
"Documents and Settings"
How is it solved?.
-
April 8th, 2007, 05:55 AM
#2
Re: problem with the spacing in the path
You can use an API to get the old short filename, and then use it.
Code:
Option Explicit
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long
Public Function GetShortPath(strFileName As String) As String
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim lngRes As Long, strPath As String
'Create a buffer
strPath = String$(165, 0)
'retrieve the short pathname
lngRes = GetShortPathName(strFileName, strPath, 164)
'remove all unnecessary chr$(0)'s
GetShortPath = Left$(strPath, lngRes)
End Function
Private Sub Command1_Click()
Dim shortfilename As String
shortfilename = GetShortPath(Dir1.Path & "\" & File1.FileName)
MsgBox (shortfilename)
End Sub
-
April 8th, 2007, 06:54 AM
#3
Re: problem with the spacing in the path
wrap command line arguments with spaces in them in quotes, e.g.:
Code:
Shell "program.exe ""C:\Test Folder\File.ext"""
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|