Kevin
Kevin

Reputation: 716

Batch gives me Invalid Path for a drive

So I have some code:

set "sourceImage=%~dp0\Files\silhouette.png"
set "targetFolder=H:"
...
for /r "%targetFolder%" %%f in (*) do (

but when I run it, the

for /r "%targetFolder%" %%f in (*) do (

line gives the error "Invalid path". Why?

Also, this loop takes a long time. Could I make it so that it will run for only a certain amount of time?

Upvotes: 0

Views: 45

Answers (1)

foxidrive
foxidrive

Reputation: 41234

Your command is fine but the path in the for command is most often used with an explicit path like "H:\" or "H:\Folder\data"

Upvotes: 1

Related Questions