Will it work if the Excel files are under Microsoft OneDrive?
Help! Printing multiple Excel files in sorted orders
Help! I have to print 30-50 excel files on weekly basis and its currently printing in random orders.
For example, I have files saved in the name of A1, A2, A3, A4, A5, A6. I have the files in descending order. When I highlight all files under the folder and right click to pint. It is printing random orders.
It would be very helpful if I can print multiple files in sorted orders, so I don't have to manually sort them.
I tried to change the printer setting by printer properties and changing settings under advanced = spooled print documents. Tried with selecting start printing after last page is spooled and it did not work. also tried with selecting start printing immediately and did not work either. Also tired with selecting and unselecting print spooked documents first.
Not of it seems to work. Can someone please help?
Windows for home | Windows 11 | Devices and drivers
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
4 answers
Sort by: Most helpful
-
Anonymous
2025-03-28T21:33:19+00:00 -
Siva Shankar 11,010 Reputation points
2025-03-28T05:39:48+00:00 1: Yes, you need to copy the following script into Notepad:
@echo off
setlocal enabledelayedexpansion
rem Change this to your folder path
set "folder=C:\Your\Folder\Path"
rem Get sorted list of files
for /f "tokens=*" %%a in ('dir "%folder%\*.xlsx" /b /o:n') do (
start /wait excel /r "%folder%\%%a")
echo All files printed.
pause
2: Replace C:\Your\Folder\Path
Find the actual path where your Excel files are stored.
For example, if your Excel files are stored in
C:\Users\YourName\Documents\ExcelFiles, replace:
set "folder=C:\Your\Folder\Path"
With:
set "folder=C:\Users\YourName\Documents\ExcelFiles"
3: Click File > Save As...
In the File name field, enter PrintExcel.bat
In the Save as type dropdown, select All Files
Click Save
4: Go to the folder where you saved PrintExcel.bat
Double-click PrintExcel.bat to run it.
It will open and print all Excel files in sorted order.
Please let me know if this works !
-
Anonymous
2025-03-27T23:36:42+00:00 Hi Shankar
Could you explain on how to do from step 3? 3: Replace C:\Your\Folder\Path with your actual folder.
Save the file as PrintExcel.bat.
Double-click to run it.
This script will open and print Excel files in sorted order.
Also to make sure I understand it correctly. copy the below to notepad?
@echo off
setlocal enabledelayedexpansionrem Change this to your folder path
set "folder=C:\Your\Folder\Path"rem Get sorted list of files
for /f "tokens=*" %%a in ('dir "%folder%\*.xlsx" /b /o:n') do (
start /wait excel /r "%folder%%%a"
) -
Siva Shankar 11,010 Reputation points
2025-03-27T04:52:54+00:00 Hello ,
I’m here to help you in resolving your issue
When you select multiple Excel files and print them all at once, Windows does not always process them in the expected order. The issue occurs because Windows sends files to the printer in the order they are retrieved by the file system, which isn't always alphabetical.
You can create a batch file to print Excel files in order.
1: Open Notepad.
2: Copy and paste the following batch script:
@echo off
setlocal enabledelayedexpansion
rem Change this to your folder path
set "folder=C:\Your\Folder\Path"
rem Get sorted list of files
for /f "tokens=*" %%a in ('dir "%folder%\*.xlsx" /b /o:n') do (
start /wait excel /r "%folder%\%%a")
echo All files printed.
pause
3: Replace C:\Your\Folder\Path with your actual folder.
Save the file as PrintExcel.bat.
Double-click to run it.
This script will open and print Excel files in sorted order.
After trying above steps, please reach out to me if you have any doubts or issues
Help others by sharing your experience! Click “Yes” if this solution worked for you or “No” if it didn’t.