BAT File Command Help

Sorry that I'm a little lost, what is the current issue? You are using it on a server and the script is reading the current folder (the one the script is sitting in) as "Windows" rather than its real name? Is that it?
 
Sorry that I'm a little lost, what is the current issue? You are using it on a server and the script is reading the current folder (the one the script is sitting in) as "Windows" rather than its real name? Is that it?
That is my understanding, when the O/S is Windows Server something.
 
@theDBguy's solution works for me.
I saved the bat in a network drive of our domain controller and executed it from a client PC. The text file with the folder name was created on desktop.

2025-04-26_19-37-36.jpg


Edit : Moved the bat to a sub sub sub folder. Still it's perfect.
 
Last edited:
Sorry that I'm a little lost, what is the current issue? You are using it on a server and the script is reading the current folder (the one the script is sitting in) as "Windows" rather than its real name? Is that it?

Yes. The BAT file appends "Windows" to the file name instead of the actual folder name.
 
Okay. I wasn't sure which script it was. Glad you got everything working the way you want.

Once I changed the folder location your script works 100%. If I understand the code correctly it writes the file names into the text file one at a time. The folders I want to use these on contain product images. Some of them have over 36k images in them. It takes a little bit for the script to add all 36k file names into the text file.

The BAT file is instant but it appends "Windows" to the text file name instead of the folder name. Because it works faster I would like to use the BAT file.

I am not complaining, just stating the state of things. I am grateful for all the help.
 
Once I changed the folder location your script works 100%. If I understand the code correctly it writes the file names into the text file one at a time. The folders I want to use these on contain product images. Some of them have over 36k images in them. It takes a little bit for the script to add all 36k file names into the text file.

The BAT file is instant but it appends "Windows" to the text file name instead of the folder name. Because it works faster I would like to use the BAT file.

I am not complaining, just stating the state of things. I am grateful for all the help.
Yeah, unfortunately VBScript (unlike VBA) doesn't have the DIR function, which would have been ~instantaneous too.
I can definitely understand preferring the BAT in this situation for sure 👍
 

Users who are viewing this thread

Back
Top Bottom