Node.js execute .lnc file





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















There was a problem when opening a shortcut (.lnk) through node.js. How should I open it?






var exec = require('child_process').execFile;

var runLibreOffice =function(){
exec('D:\Downloads\bot\botgo.lnk', function(err, data) {
console.log(err)
console.log(data.toString());
});
}
runLibreOffice();












share|improve this question

























  • Hello, this script shows any error? Have you seen nodejs.org/api/… ? const execFile = require('child_process').execFile; const child = execFile('node', ['--version'], (error, stdout, stderr) => {})

    – Cuchu
    Nov 22 '18 at 21:28













  • Hey. The script normally opens .exe files. But with .lnc problems with him. Shows this error: { Error: Command failed: D:Downloadsbotbotgo.lnk "D:Downloadsbotbotgo" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���. at ChildProcess.exithandler (child_process.js:289:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) killed: false, code: 1, signal: null, cmd: 'D:\Downloads\bot\botgo.lnk' }

    – Даниил Рыбальченко
    Nov 22 '18 at 21:45













  • Check this question and response stackoverflow.com/questions/41497183/…

    – Cuchu
    Nov 22 '18 at 21:49











  • More information about this problem dzone.com/articles/…

    – Cuchu
    Nov 22 '18 at 21:51











  • At the moment I got this code: spawn('D:\Downloads\bot\botgo.lnk', {shell : true}, function(err, data). When you run the file, nothing is displayed in the console and does not start.

    – Даниил Рыбальченко
    Nov 22 '18 at 22:03




















2















There was a problem when opening a shortcut (.lnk) through node.js. How should I open it?






var exec = require('child_process').execFile;

var runLibreOffice =function(){
exec('D:\Downloads\bot\botgo.lnk', function(err, data) {
console.log(err)
console.log(data.toString());
});
}
runLibreOffice();












share|improve this question

























  • Hello, this script shows any error? Have you seen nodejs.org/api/… ? const execFile = require('child_process').execFile; const child = execFile('node', ['--version'], (error, stdout, stderr) => {})

    – Cuchu
    Nov 22 '18 at 21:28













  • Hey. The script normally opens .exe files. But with .lnc problems with him. Shows this error: { Error: Command failed: D:Downloadsbotbotgo.lnk "D:Downloadsbotbotgo" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���. at ChildProcess.exithandler (child_process.js:289:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) killed: false, code: 1, signal: null, cmd: 'D:\Downloads\bot\botgo.lnk' }

    – Даниил Рыбальченко
    Nov 22 '18 at 21:45













  • Check this question and response stackoverflow.com/questions/41497183/…

    – Cuchu
    Nov 22 '18 at 21:49











  • More information about this problem dzone.com/articles/…

    – Cuchu
    Nov 22 '18 at 21:51











  • At the moment I got this code: spawn('D:\Downloads\bot\botgo.lnk', {shell : true}, function(err, data). When you run the file, nothing is displayed in the console and does not start.

    – Даниил Рыбальченко
    Nov 22 '18 at 22:03
















2












2








2








There was a problem when opening a shortcut (.lnk) through node.js. How should I open it?






var exec = require('child_process').execFile;

var runLibreOffice =function(){
exec('D:\Downloads\bot\botgo.lnk', function(err, data) {
console.log(err)
console.log(data.toString());
});
}
runLibreOffice();












share|improve this question
















There was a problem when opening a shortcut (.lnk) through node.js. How should I open it?






var exec = require('child_process').execFile;

var runLibreOffice =function(){
exec('D:\Downloads\bot\botgo.lnk', function(err, data) {
console.log(err)
console.log(data.toString());
});
}
runLibreOffice();








var exec = require('child_process').execFile;

var runLibreOffice =function(){
exec('D:\Downloads\bot\botgo.lnk', function(err, data) {
console.log(err)
console.log(data.toString());
});
}
runLibreOffice();





var exec = require('child_process').execFile;

var runLibreOffice =function(){
exec('D:\Downloads\bot\botgo.lnk', function(err, data) {
console.log(err)
console.log(data.toString());
});
}
runLibreOffice();






javascript node.js npm node-modules child-process






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 20:03







Даниил Рыбальченко

















asked Nov 22 '18 at 19:44









Даниил РыбальченкоДаниил Рыбальченко

112




112













  • Hello, this script shows any error? Have you seen nodejs.org/api/… ? const execFile = require('child_process').execFile; const child = execFile('node', ['--version'], (error, stdout, stderr) => {})

    – Cuchu
    Nov 22 '18 at 21:28













  • Hey. The script normally opens .exe files. But with .lnc problems with him. Shows this error: { Error: Command failed: D:Downloadsbotbotgo.lnk "D:Downloadsbotbotgo" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���. at ChildProcess.exithandler (child_process.js:289:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) killed: false, code: 1, signal: null, cmd: 'D:\Downloads\bot\botgo.lnk' }

    – Даниил Рыбальченко
    Nov 22 '18 at 21:45













  • Check this question and response stackoverflow.com/questions/41497183/…

    – Cuchu
    Nov 22 '18 at 21:49











  • More information about this problem dzone.com/articles/…

    – Cuchu
    Nov 22 '18 at 21:51











  • At the moment I got this code: spawn('D:\Downloads\bot\botgo.lnk', {shell : true}, function(err, data). When you run the file, nothing is displayed in the console and does not start.

    – Даниил Рыбальченко
    Nov 22 '18 at 22:03





















  • Hello, this script shows any error? Have you seen nodejs.org/api/… ? const execFile = require('child_process').execFile; const child = execFile('node', ['--version'], (error, stdout, stderr) => {})

    – Cuchu
    Nov 22 '18 at 21:28













  • Hey. The script normally opens .exe files. But with .lnc problems with him. Shows this error: { Error: Command failed: D:Downloadsbotbotgo.lnk "D:Downloadsbotbotgo" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���. at ChildProcess.exithandler (child_process.js:289:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) killed: false, code: 1, signal: null, cmd: 'D:\Downloads\bot\botgo.lnk' }

    – Даниил Рыбальченко
    Nov 22 '18 at 21:45













  • Check this question and response stackoverflow.com/questions/41497183/…

    – Cuchu
    Nov 22 '18 at 21:49











  • More information about this problem dzone.com/articles/…

    – Cuchu
    Nov 22 '18 at 21:51











  • At the moment I got this code: spawn('D:\Downloads\bot\botgo.lnk', {shell : true}, function(err, data). When you run the file, nothing is displayed in the console and does not start.

    – Даниил Рыбальченко
    Nov 22 '18 at 22:03



















Hello, this script shows any error? Have you seen nodejs.org/api/… ? const execFile = require('child_process').execFile; const child = execFile('node', ['--version'], (error, stdout, stderr) => {})

– Cuchu
Nov 22 '18 at 21:28







Hello, this script shows any error? Have you seen nodejs.org/api/… ? const execFile = require('child_process').execFile; const child = execFile('node', ['--version'], (error, stdout, stderr) => {})

– Cuchu
Nov 22 '18 at 21:28















Hey. The script normally opens .exe files. But with .lnc problems with him. Shows this error: { Error: Command failed: D:Downloadsbotbotgo.lnk "D:Downloadsbotbotgo" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���. at ChildProcess.exithandler (child_process.js:289:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) killed: false, code: 1, signal: null, cmd: 'D:\Downloads\bot\botgo.lnk' }

– Даниил Рыбальченко
Nov 22 '18 at 21:45







Hey. The script normally opens .exe files. But with .lnc problems with him. Shows this error: { Error: Command failed: D:Downloadsbotbotgo.lnk "D:Downloadsbotbotgo" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���. at ChildProcess.exithandler (child_process.js:289:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) killed: false, code: 1, signal: null, cmd: 'D:\Downloads\bot\botgo.lnk' }

– Даниил Рыбальченко
Nov 22 '18 at 21:45















Check this question and response stackoverflow.com/questions/41497183/…

– Cuchu
Nov 22 '18 at 21:49





Check this question and response stackoverflow.com/questions/41497183/…

– Cuchu
Nov 22 '18 at 21:49













More information about this problem dzone.com/articles/…

– Cuchu
Nov 22 '18 at 21:51





More information about this problem dzone.com/articles/…

– Cuchu
Nov 22 '18 at 21:51













At the moment I got this code: spawn('D:\Downloads\bot\botgo.lnk', {shell : true}, function(err, data). When you run the file, nothing is displayed in the console and does not start.

– Даниил Рыбальченко
Nov 22 '18 at 22:03







At the moment I got this code: spawn('D:\Downloads\bot\botgo.lnk', {shell : true}, function(err, data). When you run the file, nothing is displayed in the console and does not start.

– Даниил Рыбальченко
Nov 22 '18 at 22:03














1 Answer
1






active

oldest

votes


















0














maybe with windows-shortcuts you can read and execute de .exe into the shortcut.



https://www.npmjs.com/package/windows-shortcuts



ws.query("C:/ProgramData/Microsoft/Windows/Start Menu/Windows Update.lnk", console.log);

/* From console:
null { expanded:
{ args: 'startmenu',
workingDir: 'C:\Windows\system32',
icon: 'C:\Windows\system32\wucltux.dll' },
target: '%windir%\system32\wuapp.exe',
args: 'startmenu',
workingDir: '%windir%\system32',
runStyle: 1,
icon: '%windir%\system32\wucltux.dll',
iconIndex: '0',
hotkey: 0,
desc: 'Delivers software updates and drivers, and provides automatic updating options.' }
*/





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53437244%2fnode-js-execute-lnc-file%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    maybe with windows-shortcuts you can read and execute de .exe into the shortcut.



    https://www.npmjs.com/package/windows-shortcuts



    ws.query("C:/ProgramData/Microsoft/Windows/Start Menu/Windows Update.lnk", console.log);

    /* From console:
    null { expanded:
    { args: 'startmenu',
    workingDir: 'C:\Windows\system32',
    icon: 'C:\Windows\system32\wucltux.dll' },
    target: '%windir%\system32\wuapp.exe',
    args: 'startmenu',
    workingDir: '%windir%\system32',
    runStyle: 1,
    icon: '%windir%\system32\wucltux.dll',
    iconIndex: '0',
    hotkey: 0,
    desc: 'Delivers software updates and drivers, and provides automatic updating options.' }
    */





    share|improve this answer




























      0














      maybe with windows-shortcuts you can read and execute de .exe into the shortcut.



      https://www.npmjs.com/package/windows-shortcuts



      ws.query("C:/ProgramData/Microsoft/Windows/Start Menu/Windows Update.lnk", console.log);

      /* From console:
      null { expanded:
      { args: 'startmenu',
      workingDir: 'C:\Windows\system32',
      icon: 'C:\Windows\system32\wucltux.dll' },
      target: '%windir%\system32\wuapp.exe',
      args: 'startmenu',
      workingDir: '%windir%\system32',
      runStyle: 1,
      icon: '%windir%\system32\wucltux.dll',
      iconIndex: '0',
      hotkey: 0,
      desc: 'Delivers software updates and drivers, and provides automatic updating options.' }
      */





      share|improve this answer


























        0












        0








        0







        maybe with windows-shortcuts you can read and execute de .exe into the shortcut.



        https://www.npmjs.com/package/windows-shortcuts



        ws.query("C:/ProgramData/Microsoft/Windows/Start Menu/Windows Update.lnk", console.log);

        /* From console:
        null { expanded:
        { args: 'startmenu',
        workingDir: 'C:\Windows\system32',
        icon: 'C:\Windows\system32\wucltux.dll' },
        target: '%windir%\system32\wuapp.exe',
        args: 'startmenu',
        workingDir: '%windir%\system32',
        runStyle: 1,
        icon: '%windir%\system32\wucltux.dll',
        iconIndex: '0',
        hotkey: 0,
        desc: 'Delivers software updates and drivers, and provides automatic updating options.' }
        */





        share|improve this answer













        maybe with windows-shortcuts you can read and execute de .exe into the shortcut.



        https://www.npmjs.com/package/windows-shortcuts



        ws.query("C:/ProgramData/Microsoft/Windows/Start Menu/Windows Update.lnk", console.log);

        /* From console:
        null { expanded:
        { args: 'startmenu',
        workingDir: 'C:\Windows\system32',
        icon: 'C:\Windows\system32\wucltux.dll' },
        target: '%windir%\system32\wuapp.exe',
        args: 'startmenu',
        workingDir: '%windir%\system32',
        runStyle: 1,
        icon: '%windir%\system32\wucltux.dll',
        iconIndex: '0',
        hotkey: 0,
        desc: 'Delivers software updates and drivers, and provides automatic updating options.' }
        */






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 23 '18 at 10:22









        CuchuCuchu

        1,164815




        1,164815
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53437244%2fnode-js-execute-lnc-file%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?