Brandon .
asked on
Help with simple script.
For loop syntax is confusing, I tried researching and I still wasn't able to make sense of the syntax. This is a very simple script and it does the following:
1 > Recursively loop through current and subdirectories, finding .jpg files
2 > once found, simply do this command
Here's what I've tried so far so that I don't look lazy.
Code works without error but does not achieve what I want. The purpose of the
1 > Recursively loop through current and subdirectories, finding .jpg files
2 > once found, simply do this command
echo. >> *.jpg
And that's itHere's what I've tried so far so that I don't look lazy.
@echo off
FOR /D %%a IN (*.jpg) DO (echo. >> *.jpg %%a)
Code works without error but does not achieve what I want. The purpose of the
echo. >> *.jpg
command is to simply send empty data to the jpg files so that the md5 is changed but without causing any problems to the picture itself
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Running the script doesn't change the md5, running the command
The wildcard seems to be weird (for a lack of a better word)
echo. >> test.jpg
does, what could be wrong?The wildcard seems to be weird (for a lack of a better word)
Before F12B908EC97DDDACA7ED58A364 CFDB55 11.png
After FB0E0949C977F495B70C1C9E8D D0B8D4 11.png
After FB0E0949C977F495B70C1C9E8D
You need to put command in a batch file, not run it directly
ASKER
The script without the /D in it is the answer, the /D was causing the problem , removed the /D and it's working
Thank you @Shaun Vermaak
Thank you @Shaun Vermaak
ASKER
The script without the /D in it is the answer, the /D was causing the problem , removed the /D and it's working
Thank you @Shaun Vermaak and @Guy Hengel [angelIII / a3]
Thank you @Shaun Vermaak and @Guy Hengel [angelIII / a3]
ASKER
Directory, name of file, etc is all right, don't know why it doesn't work
The command
Open in new window
seems to be the problemTrying
Open in new window
works instead..