'How to open all files in a directory from command prompt
I wan't to open up every excel file in a certain folder using the windows command prompt. I know I can do this if I know the name of each file, but I want to just open all as the file names might change. Thanks.
Solution 1:[1]
for %1 in (*.xlsx) do start excel "%%1"
In the command prompt, you can execute the above command which opens all the excel sheets in the current directory. You could store this as batch file by giving full path too
for %1 in (<path>\*.xlsx) do start excel "%%1"
Edit: As @CristiFati noted, if the excel is not there in the path,
for %1 in (<path>\*.xlsx) do "C:\Program Files (x86)\Microsoft Office\Office16\EXCEL.exe" "%%1"
Solution 2:[2]
Navigate to the folder in command prompt.
Then run the following command
FOR %F IN (*.*) DO START %F
Credit goes to here: https://superuser.com/questions/1503993/cmd-command-to-open-all-files-in-a-subdirectory
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | GuyTryingToSolveAnIssue |
