Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

255
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda