Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(5 edits)

If you just mean opening externally from the game or another app, then I can give you an example script to go off from as its very simple to do using a just bit of C#. Most of the code for just opening the files is mostly the same for each script file. This is what I've done in unity, even though it works with a visual studio console application as well.

Unity Code:


________________________________________________________

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class OpenFileInUnity : MonoBehaviour {

void OnEnable() {
 //will open if exe is in same directory as launchers exe file.
 System.Diagnostics.Process.Start("PLACENAMEHERE.bat");
}

_______________________________________________________________________



Console App Visual Studio Code:

________________________________________________________

using System;

namespace ExampleScript
{
    class Program
    {
        static void Main(string[] args)
        {
           System.Diagnostics.Process.Start("PLACENAMEHERE.bat");
        }
    }
}

_______________________________________________________________________


  For the "PLACENAMEHERE" part you will simply change that to the name of the file you want to open including the extension at the end like .bat, .vbs, etc. After that you will want to make sure to place that vbs or batch file right next to the complied c# application. Then finally, it should work perfectly for opening these apps in the background. Hope that helps :)

Deleted post

Much appreciated!