SoyArcano

Run two photos using a var

3 posts in this topic

#1 ·  Posted

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Xandy

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

Share this post


Link to post
Share on other sites

#3 ·  Posted

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,
 

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