Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

252
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda