I'm writing a command line batch script in Windows 7 to upload multiple images for hosting, paste the url (using this program) and filename into a line of text, then append the text to a file.
The following code gives me an error because the command "cmd /c" is too long.
@echo on
set DIR1="C:\Users\My\Desktop\temp"
set DIR2="C:\Misc\Programs\EasyImgur"
set DIR3="C:\Users\My\Desktop"
set DIR2=%DIR2:"=%
set DIR3=%DIR3:"=%
forfiles /m *.png /p %DIR1% /c "cmd /c %DIR2%\EasyImgur.exe /anonymous @path && timeout /t 2 /nobreak > NUL && paste > %DIR3%\temp.txt && set /p URL= < %DIR3%\temp.txt && echo if(G9="@fname",IMAGE(%URL%,3), >> %DIR3%\test.txt"
del %DIR3%\temp.txt
pause
exit
Is there any way around this? Some way to call all that text after "cmd /c" without breaking the character limit? I need all that done for every file in the directory.
Thanks in advance.