Whenever I run this I click and drag to an open cmd window and then I run it and it says ": was unexpected at this time".
Why?
Here is my code (my longest yet):
Code: Select all
@echo off
title ProDOS Studio Beta
set "`="
setx dynamicvariable %`%
:start
set /p b= Program to run- (directory:\filepath\file.fileextension)
cls
setlocal disableDelayedExpansion
set "file=%b%"
set "search=listschedtasks /newtask /userinput=1 "
for /f "delims=" %%A in ('findstr /i /c "%search%" "%file%"') do (
set "ln=%%A"
set /p k=Enter time to run program:
set /p l=Do you want a reccuring date? (enter lowercase y/n):
if /i _"%l%"==_"y" (goto recurdate)
at %k% "!ln:*%search%=!"
:recurdate
set /p m=Enter a recurring date:
at %k% %m% !ln:*%search%=!
setlocal enableextensions
break
endlocal)
if %errorlevel%==1 (goto c)
goto :eof
What happens is when I run it is supposed to look for the text string listschedtasks /newtask /userinput=1 and execute the code that occurs in the "do" section of the "for" string. But for me it says "findstr- /c ignored" "findstr- cannot open %b%" "invalid command".
And then it continues with the program from :recurdate and then comes up with the error "endlocal)" is not recognised as a internal or external command or batch file."
Could you at least attempt to explain this?
Regards,
Rileyh