MattXu Posted January 25, 2014 Posted January 25, 2014 hello: in script, I have code like this: #include <Constants.au3> #include <Date.au3> #include <ScreenCapture.au3> ShellExecute("C:BlueHills.jpg") by running this script, windows will use a default application to open this picture, but how to do it in C#? All I can find is AutoItX.Run(....); using AutoIt; using System; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { AutoItX.Run("ss.png", @"C:\Users\XuChun\Pictures"); Console.ReadLine(); } } } AutoItX.Run() can only execute an .exe application, it can't find a default application to open my picture I didn't find ShellExecute() in AutoIt .Net lib, or did I miss something? What can I do? thanks
JohnOne Posted January 25, 2014 Posted January 25, 2014 System.Diagnostics.Process.Start("path\to\file.ext"); Possibly. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Richard Robertson Posted January 26, 2014 Posted January 26, 2014 If you want to use ShellExecute, you must actually create a Process object and set the properties to make it use ShellExecute instead of the standard process creation. http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.useshellexecute.aspx
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