krasnoshtan

Path in variable

5 posts in this topic

#1 ·  Posted

Hi all! How to run this code. I want to start wmp, but i am need to run wmp in spite of
 that a system drive is not "C:"

sorry if i write wrong, i am a new here ;)

here a code

$all_wmp = @ProgramFilesDir & "\windows media player\wmlpayer.exe"
MsgBox (0, 0, $all_wmp)
Run ($all_wmp)

Share this post


Link to post
Share on other sites



#2 ·  Posted

I believe that the @ProgramFilesDir macro will return the Program Files directory of the host system.

If installation is outside of the Program Files directory you can have the user browse for file path to location and save setting.  Alternatively you maybe able to check the registry for the file path of Windows Media Player exe.  I'll research the registry idea real quick.


I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

#3 ·  Posted

$all_wmp = @ProgramFilesDir & "\windows media player\wmlpayer.exe"

If FileExists( $all_wmp) Then
    Run ($all_wmp)
Else
    MsgBox (0, "ERROR", "The File was not found    " & @crlf & $all_wmp)
    ; do something else... find file etc...
EndIf

Maybe...

 

8)

2 people like this

NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@krasnoshtan 

Also note that "wmplayer.exe" is miss-spelled in your string as "wmlpayer.exe".

Edited by Xandy

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

#5 ·  Posted

17 minutes ago, Valuater said:
$all_wmp = @ProgramFilesDir & "\windows media player\wmlpayer.exe"

If FileExists( $all_wmp) Then
    Run ($all_wmp)
Else
    MsgBox (0, "ERROR", "The File was not found    " & @crlf & $all_wmp)
    ; do something else... find file etc...
EndIf

 

thanks you so much

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now