Home > Back-end >  Script to execute all .exe's inside a given folder
Script to execute all .exe's inside a given folder

Time:07-23

Can someone please write me a short script that will run all .exe files inside a given folder? I am doing this for my system image

CodePudding user response:

  1. Here you don't get coding service. If you search on google you find so many tutorial for this. So the next time don't ask to us to write your code, ask how to do it.

  2. Here is already a question about this.

Python : get all exe files in current directory and run them?

CodePudding user response:

@Firestone 3942

So

the first one will do it?

Would do it right? I understand that Imma have to use ".exe" instead of the original name of those files because I want to have this script run all .exe files, is this correct?

But where is the name of the folder in which these .exe files will be found?

CodePudding user response:

You can use os.chdir("path") to move to the target directory.

If you want to be sure you are in the target directory use os.getcwd(), it will print the dir wjere you are.

They are the correspondents of the cd and dir commands in bash.

  • Related