copy file from network shared drive to desktop using DOS copy command in Javascript

364 views Asked by At

I am looking for the code, where i need to copy file from network shared drive to desktop using DOS copy command in javascript. As sample code below:

Sample Code:

oShell = new ActiveXObject("Shell.Application");

oShell.ShellExecute(cmd.exe, copy C:\text123.txt D:\folder\, "", "open", "1");
1

There are 1 answers

0
AudioBubble On

From Help for your language.

fso = new ActiveXObject("Scripting.FileSystemObject");

fso.CopyFile ("c:\\mydocuments\\letters\\*.doc", "c:\\tempfolder\\")

What is wrong with your code is the cmd syntax is wrong. Type cmd /?.