Execute bat file with unix credentials and file transfer to UNIX box in javascript
NickName:Shabar Ask DateTime:2022-12-11T18:07:14

Execute bat file with unix credentials and file transfer to UNIX box in javascript

How can I execute bat file from windows with credentials.

Checked this solution and just curious how to pass the credentials to login to unix server and then do some steps using bat file?

fs.chmodSync('./myFile.bat', 0o755);

    let spawn = require('child_process').spawn,
        ls = spawn('cmd.exe',["/c", `C:\\myFile.bat`], ["","\\data\\myFromFolder"] );

    ls.stdout.on('stdout', function (error, stdout, stderr) {
            if (error) {
                console.error(error);
                return;
            }
        console.log('stdout: ' + stdout);
    });

Basically I need to pass parameters to the bat file. from the javascrpt code.

I set some default parameters in the .bat file, But the first three param has to be local folder path, username , password

Similar to this issue

Copyright Notice:Content Author:「Shabar」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/74759876/execute-bat-file-with-unix-credentials-and-file-transfer-to-unix-box-in-javascri

More about “Execute bat file with unix credentials and file transfer to UNIX box in javascript” related questions

Execute bat file with unix credentials and file transfer to UNIX box in javascript

How can I execute bat file from windows with credentials. Checked this solution and just curious how to pass the credentials to login to unix server and then do some steps using bat file? fs.chmodS...

Show Detail

Run .bat script in unix

I have one .bat script on my windows share that is mounted to my UNIX machine. Bat script is set to make file transfer between 2 windows shares, but I would like to trigger this script from a unix

Show Detail

Unix File Transfer to RAM

I am working on Unix server. I need to transfer a file from one unix server's disk space to Other unix server's RAM (in -memory). I could not find exact option to perform the task. I am not allowed...

Show Detail

Download file program using php on unix box

I have created a beginner program to forcefully download file from unix box to windows through browser, it is not throwing any error but shows nothing on browser just a blank page. PHP version- 5...

Show Detail

How to run .bat file on unix server

I am not able to run ".bat" file on Unix server I have run following command to run that ".bat" file. sh Run.bat where Run.bat is ".bat" file. It gives me following error Invalid file

Show Detail

Bat/Shell file copy to Unix/Windows

I got the task to write a script to do some tasks, one of those is to copy some files from the local machine to a server directory. Now this isn't exactly my area of expertise, so I was wondering if

Show Detail

file transfer from local machine to unix

Is there a way to transfer a file in local machine(Windows os) to a unix sever by using commands from within the unix server(not from the windows command prompt)??

Show Detail

How to transfer a file using sftp in UNIX

I want to transfer a .png file from a directory on my computer to a directory on a remote server. I have to use SFTP to secure the file and transfer mode. And I already have a UNIX script (.ksh) ...

Show Detail

How to check file transfer completion in unix

How can I check file transfer completion in unix e.g. 2GB file is getting transferd and before openning it I would like check weather the file is still under process or not.

Show Detail

How to execute command / script file in UNIX using mule?

H, I am trying to figure out a best way to execute a command / script file in UNIX box using mule. Can someone confirm if this is a right way to execute command in unix via mule? <script:comp...

Show Detail