---
title: "Comment by DoyinSoft Technologies on \"My Little Automation Script\" | Hashnode"
description: "chougle saud So I decided to enhance the codes making it possible to type in the desired path upon execution of the script: you can find the new script below co"
url: "https://hashnode.com/posts/my-little-automation-script/5fd5ac10f60e3973bae6bca8/comment/5fe05f76b78ac62dff80f0c7"
---

[Discussion](https://hashnode.com/posts/my-little-automation-script/5fd5ac10f60e3973bae6bca8)

Comment [My Little Automation Script](https://hashnode.com/posts/my-little-automation-script/5fd5ac10f60e3973bae6bca8)

[DoyinSoft Technologies](https://hashnode.com/@doyinsoft)

[Dec 21, 2020](https://hashnode.com/posts/my-little-automation-script/5fd5ac10f60e3973bae6bca8/comment/5fe05f76b78ac62dff80f0c7)

[chougle saud](https://hashnode.com/@chouglesaud) So I decided to enhance the codes making it possible to type in the desired path upon execution of the script:

you can find the new script below

```

const { exec } = require("child_process");
const readline = require("readline");
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});
var fp = "";
rl.question("Enter a Valid Path to Open: ", function (p) {
  fp = p;
  main();
  rl.close();
});

function main() {
  launchVSCodeAt(fp);
  launchTerminalAt(fp);
}

function launchVSCodeAt(path) {
  exec(`cd ${path} && code .`, (err) => {
    if (err) console.log(`failed to launch VSCode at ${path}`);
    console.log(`VSCode launched at ${path}`);
  });
}
function launchTerminalAt(path) {
  exec(`cd ${path} && start cmd`, (error) => {
    if (error) console.log(`failed to launch Terminal at ${path}`);
    console.log(`Terminal launched at ${path}`);
  });
}
```

[saud chougle](https://hashnode.com/@chouglesaud)

[Dec 21, 2020](https://hashnode.com/posts/my-little-automation-script/5fd5ac10f60e3973bae6bca8/comment/5fe05f76b78ac62dff80f0c7#reply-5fe0a62ae2fcaa59715f43c6)

intresting. i will definitely try out. one catch how will we remember path 🤔.

[DoyinSoft Technologies](https://hashnode.com/@doyinsoft)

[Jan 11, 2021](https://hashnode.com/posts/my-little-automation-script/5fd5ac10f60e3973bae6bca8/comment/5fe05f76b78ac62dff80f0c7#reply-5ffc5605aa5c467fe155ae54)

Always copy paths from the window explorer text box [chougle saud](https://hashnode.com/@chouglesaud)
