SoyArcano Posted May 6, 2017 Posted May 6, 2017 Hello i'm trying run two of my pictures to open at the same time so i dont need to go to the dir and open one by one. The code is: $f1 = "Run(mypath&" & '"' & "\New.jpg" & '"' & ")" $f2 = "Run(mypath&" & '"' & "\Autoit.jpg" & '"' & ")" I tried using comspec. $f1 = "Run(@ComSpec &"& '" /c "' &"mypath&" & '"' & "\New.jpg" & '"' & ")" $f2 = "Run(@ComSpec &"& '" /c "' &"mypath&" & '"' & "\New.jpg" & '"' & ")" But doesnt work too. What i'm doing wrong?
Xandy Posted May 6, 2017 Posted May 6, 2017 (edited) As far as I know an image file is not technically executable. Can an image be run if it's not executable? Idk it didn't work for me either try ShellExecute $path_1 = @ScriptDir & "\0 0.bmp" $path_2 = @ScriptDir & "\0 1.bmp" ShellExecute($path_1) ShellExecute($path_2) Edited May 6, 2017 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
Trong Posted May 6, 2017 Posted May 6, 2017 43 minutes ago, SoyArcano said: Hello i'm trying run two of my pictures to open at the same time so i dont need to go to the dir and open one by one. The code is: $f1 = "Run(mypath&" & '"' & "\New.jpg" & '"' & ")" $f2 = "Run(mypath&" & '"' & "\Autoit.jpg" & '"' & ")" I tried using comspec. $f1 = "Run(@ComSpec &"& '" /c "' &"mypath&" & '"' & "\New.jpg" & '"' & ")" $f2 = "Run(@ComSpec &"& '" /c "' &"mypath&" & '"' & "\New.jpg" & '"' & ")" But doesnt work too. What i'm doing wrong? syntax error! Try Global $iDir = @DesktopDir Global $iPhoto1 = "1.jpg" Global $iPhoto2 = "2.jpg" Global $f1, $f2 ;~ $f1 = Run(@ComSpec & ' /c "' &$iDir & "\" & $iPhoto1 & '"') ; Work ;~ $f1 = Run(@ComSpec & ' /c "' &$iDir & "\" & $iPhoto2 & '"') ; Work $f1 = ShellExecute('"' & $iDir & "\" & $iPhoto1 & '"') ; work $f1 = ShellExecute('"' & $iDir & "\" & $iPhoto2 & '"') ; work Regards,
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now