Jump to content

Run two photos using a var


Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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,
 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...