SHELL with a file offered as a parameter

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15581
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

SHELL with a file offered as a parameter

Post by ChrisGreaves »

I had this working until I re-installed WinAmp (2007 version so yes, ancient, but it works).
I believe that I have somehow messed up my Shell command, because like an idiot I changed the VBA when WiunAmp did not pick up the file!

Code: Select all

Function PlayWinAmp(strFullname As String)
    Dim strCmd As String
    strCmd = """C:\Program Files (x86)\Winamp\Winamp.exe"" " & """" & strFullname & """"
    Debug.Print strCmd
    Shell strCmd
End Function
Sub TESTPlayWinAmp()
    Dim strFullname As String
    strFullname = "T:\Greaves\Products\USER\Playr\20210815_1036.M3U"
    Call PlayWinAmp(strFullname)
End Sub
I have loaded the TEST macro with today's file and used Everthing.exe to check that the fullname, copied from the debug window, does exist.
Untitled.png
The shell command loads Winamp but Winamp shows only the name of the file, not the fifty or so filenames within the M3U file (see below). The shell command is working in that the name of the file gets to WinAmp, but that is not what Winamp requires.
Further, when from WinAmp I browse to that file, WinAmp opens the M3U and starts playing seven hours of music.
Untitled2.png
I believe that the file created is valid and that Winamp has no problem with the file.
I think that the problem lies within my use of the Shell command.
Untitled3.png
The Debug.print statement within my function causes this to appear in the immediate window.
I have tried a few variations on the use of double-quotes in the command line with little effect.
Any suggestions would be greatly appreciated.
Thanks
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15581
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: SHELL with a file offered as a parameter (Solved - sort of)

Post by ChrisGreaves »

ChrisGreaves wrote:
15 Aug 2021, 13:27
I had this working until I re-installed WinAmp (2007 version so yes, ancient, but it works).
Untitled.png
I came inside to avoid The Unbearable Heat Of Summer and thought to re-re-install WinAmp.
This time I used a later version (from 2008), and waddyaknow?!!???
It worked.
I mean that my existing VBA code worked.
I said "Solved - sort of" because while this is a later version of WinAmp, and my VBA code is unchanged from that posted two hours ago, I went with all the default options in WinAmp on this installation, except for the three "WinAmp toolbar", "50 free tracks" nonsense.

I now suspect that a week or so ago, I disabled something i should have left enabled in that installation.

Time for lunch.
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle