Re: Convert Script to Exe
What is the script? I've never seen anything like that. Anyways, the only thing that I can think of is Process.Start. However you mention that it's an XML file, I would think if you called .Start on an XML file it'd probably open it up in your default web browser.
Re: Convert Script to Exe
Hi
Thanks for quick replay It my custom developed application Imacro where user can record actions and save it(xml) for future use - when user wish to use this script he need to open my program and load the script in my program then need to click on play button
I wish to reduce this manual work to open program - load script - click on play button
I wish user will simply click on saved script (currently I am saving it to xml format but I can if required) and it will be played back
some thing like vbscript
Re: Convert Script to Exe
So you're essentially wanting to write your own language and launch it from visual basic?
Edit - I just found this, but I really don't know enough to help you out any further. Although I do feel like Process.Start will probably be what you need.
Re: Convert Script to Exe
Actually, it sounds like what you want to do is have a file extension linked to your app such that clicking on such a file will launch and run, much the way that clicking on an .xls file will launch Excel. Is that correct?
Re: Convert Script to Exe
Hi yes , so far I reached to a conclusion that I can achieve this part by using batch file like
start "" notepad "E:\some file with spaces.txt"
but still worried about - how my program will identified that it is opened form a batch request and due to that automatically click on a play button, because currently user need to open my program then open/load file in my program and click on play button I wish to reduce this process
Re: Convert Script to Exe
Hi yes , so far I reached to a conclusion that I can achieve this part by using batch file like
start "" notepad "E:\some file with spaces.txt"
but still worried about - how my program will identified that it is opened form a batch request and due to that automatically click on a play button, because currently user need to open my program then open/load file in my program and click on play button I wish to reduce this process
Re: Convert Script to Exe
Shree as Shaggy Hiker pointed out you want to change the file extension for your "script" to something else that isn't already being used (be creative). So change it from script.xml to script.123 then when you double click the .123 file windows will prompt you for the program to use. Select your program and check the box to always use your exe with that file extension. Then in your program you just add this to the application startup:
Code:
Private Sub Application_Startup(ByVal sender As Object, ByVal e As System.Windows.StartupEventArgs) Handles Me.Startup
Dim strScriptPath As String
If e.Args.Length <> 0 Then
strScriptPath = (e.Args(0).ToString)
'Code to open script and run it
End If
End Sub
Re: Convert Script to Exe
hi
yes i found few article how to map my custom file name with my program like .123 extantion will get open in my program it self
associate the file type to the application
Application Registration
Thanks for all help