From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Windows Picture and Fax Viewer to open up and image on my network share - Labview Automate this?

Solved!
Go to solution

I was trying to do this with a command line but I cant seem to get it to work.  The filepath would be something like this  \\Computer\Pictures\image.jpg

 

Or

 

Is there a way to open the file with the windows default program assocation?

 

Thanks,

Branson

LV 8.2

0 Kudos
Message 1 of 7
(3,646 Views)

Use System Exec and use the path to the picture as your command line.

0 Kudos
Message 2 of 7
(3,642 Views)

I have been trying to use System Exec vi with no success.  But, I did find out why it hasn't been working.  If the path to the file has no spaces then it WORKS.  If there is any spaces in the folder or file name, then it DOESN'T WORK.  

 

C:\Sunset.jpg Smiley Happy

 

C:\Copy of Sunset.jpg  Smiley Sad

 

How do i get the file paths with spaces in them to work?

 

-Branson

WinXP Pro SP3

LV 8.2

0 Kudos
Message 3 of 7
(3,631 Views)

After some research, I found this article...

 

Converting a Long Path to the Old DOS-styled 8.3

http://zone.ni.com/devzone/cda/epd/p/id/828

 

I modified the code a little to accept a path.  Here is the result...

 

C:\Copy of Sunset.jpg  ----->   C:\COPYOF~1.JPG

 

Then I use this path and send it to the Systemexec.vi and my file opens with whatever the windows default application is previously set.

0 Kudos
Message 4 of 7
(3,625 Views)

...but

 

 

\\Server\MY Database\Pictures\OGP Fixture Setup\zero setup.jpg

 

-----> \\Server\MY Database\Pictures\OGPFIX~1\ZEROSE~1.JPG

 

 

The conversion program didn't remove the space between "MY" and "Database"

 

Is there anything else to try?

-Branson

0 Kudos
Message 5 of 7
(3,617 Views)
Solution
Accepted by topic author Branson
Try double quotes around the path.
Message 6 of 7
(3,612 Views)

Double quotes around the path was part of the answer, Thanks to Darin.K

The other part was that I needed to prepend "cmd \c " to the string before passing it to Systemexec.vi.

 

cmd /c "\\Server\MY Database\Pictures\image.jpg"  -----> Command Line input of Systemexec.vi

 

 

 

 

Now all my links are working!

 

Thanks again,

Branson

0 Kudos
Message 7 of 7
(3,608 Views)