Mar-16-2023, 09:02 PM
OK, buran helped my in another thread and I am immensely grateful.
Now I want to get the file names (including their path) on my hard drive. I have researched and researched and came up with something that I thought would work.
Here is my feeble attempt at doing a windows command prompt for the directory of C: hoping to use DIR command.
subprocess.run(["C:\\windows\\system32\\cmd.exe", "/C", "dir ", "c:*.*", " /S /O:N /B /L", "dirtest001.txt"],shell=True)
So, when running my script it gets to this and the error comes up "File not found" nothing else. Not sure what is wrong but...
Oh, some explanation:
I am trying to get the complete path and filename of the files on my hard drive and save it to a file. Using windows command I issue the command "dir c:\*.* /S /O:N /B /L >dirtest001.txt" and this works. Takes a while but works. "Porting" it into the subprocess.run command, well, I said it above.
Any help would be greatly appreciated.
Now I want to get the file names (including their path) on my hard drive. I have researched and researched and came up with something that I thought would work.
Here is my feeble attempt at doing a windows command prompt for the directory of C: hoping to use DIR command.
subprocess.run(["C:\\windows\\system32\\cmd.exe", "/C", "dir ", "c:*.*", " /S /O:N /B /L", "dirtest001.txt"],shell=True)
So, when running my script it gets to this and the error comes up "File not found" nothing else. Not sure what is wrong but...
Oh, some explanation:
I am trying to get the complete path and filename of the files on my hard drive and save it to a file. Using windows command I issue the command "dir c:\*.* /S /O:N /B /L >dirtest001.txt" and this works. Takes a while but works. "Porting" it into the subprocess.run command, well, I said it above.
Any help would be greatly appreciated.