Results 1 to 9 of 9

Thread: Convert Script to Exe

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    13

    Convert Script to Exe

    I am stuck with one point , I developed a micro recorder which will record and play back user action form IE

    for example

    action Go (http://google.com)
    action set q="hiop"
    click button = scr
    I am saving this script in xml format , when user wish to play back this script he need to load the saved script in my program and click on play button then program play back the script

    Now I wish to save this script as batch file or exe or some thing similar so when user click on it , It will automatically open new instance my program ,load the script and play back it so user dont have to load manually and click on play button

    Thanks

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,371

    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.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    13

    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

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,371

    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.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,102

    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?
    My usual boring signature: Nothing

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    13

    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

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    13

    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

  8. #8
    Lively Member
    Join Date
    Oct 2007
    Posts
    64

    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

  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    13

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width