Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

251
Views
How to move a file with JavaScript

I want to move a txt file from drive c to drive d and I found this code by searching but it does not work properly. please guide me. Thanks

<html>
  <body>
    <script language="JScript">
      function move() {
        var object = new ActiveXObject("Scripting.FileSystemObject");
        var file = object.GetFile("C:\\1.txt");
        file.Move("d:\\");
        console.log("File is moved successfully");
      }
    </script>
      <button onClick="move()">Move File txt</button>
  </body>
</html>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Browsers do not provide any features that let code provided by a webpage move files the users' hard disks.


The code you've found may have worked in old versions of Internet Explorer (I think the feature was removed in later versions) but only when the security settings were altered from the default to allow it.

You could probably use it in server-side Classic ASP (but then it would move files on the server rather than the client).


For a browser-style UI which can do this, look to tools like Electron which pair a custom browser with Node.js in a desktop application. You can then use the Node.js side of your custom application to move files.

Obviously this will require that the user download and install your application and use that instead of their web browser.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!