0

I need to hide a running Deno program in the background, hiding the console. The project only runs on the Windows 10 platform,This project will be packaged as an .exe. I want to run it without the window display. Is there a way to achieve this?

enter image description here

Deno compile command : deno compile --allow-all index.js --stable

    //index.js
    import modbus_tcp_clinet from "./modbus_tcp_clinet.js";
    import html_content from "./html_content.ts";


    const Path = "./configuration.json";
    const configuration = await Deno.readTextFile(Path); 
    const currentWorkingDirectory = Deno.cwd(); 
    let fiberConf = JSON.parse(configuration);
    let modbusTcp = new modbus_tcp_clinet(fiberConf);
    console.log(Deno.env.get("SW_HIDE"));

    // const p = Deno.run({
    //     cmd: ["C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe", `--app=${currentWorkingDirectory}/occ.html`],
    // });
    // await p.status();
    // console.log(p)
    const p1 = Deno.run({
      cmd: [
        "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe",
        `--app=http://localhost:7075/`,
      ],
    });
    await p1.status();

    console.log(p1);
    
    const server = Deno.listen({ hostname: "localhost", port: 7075 });
    for await (const conn of server) {
      serveHttp(conn);
    }

enter image description here

fedonev
  • 20,327
  • 2
  • 25
  • 34
bengbeng
  • 1
  • 3
  • 1
    Possible answer: https://stackoverflow.com/a/39888695/10977818 – EternalObserver Dec 26 '22 at 07:05
  • Please provide enough code so others can better understand or reproduce the problem. – Community Dec 26 '22 at 07:14
  • 1
    Does this answer your question? [How to run a PowerShell script without displaying a window?](https://stackoverflow.com/questions/1802127/how-to-run-a-powershell-script-without-displaying-a-window) – jsejcksn Dec 26 '22 at 10:19

0 Answers0