What I'm trying to accomplish, is to have the batch file prompt the user to input their specific folder on our team's directory, and then prompt for a specific command to be used, and redirected to a TXT file on that directory. To keep it simple, the name of the file is the complete command. Batch file:
@echo off
set /p FOL=enter your folder name on "N:\GROUP NETWORK FOLDER\":
set /p CMD=enter command:
%FOL%
%CMD% > "\\NETWORK DRIVE\GROUP NETWORK FOLDER\%FOL%\%CMD%.TXT"
Running the batch file results in this output:
enter your folder name on "N:\GROUP NETWORK FOLDER\": MY FOLDER
enter command:ping Remote-PC
MY FOLDER is not a recognized as an internal or external command, operable program or batch file.
Ultimately, the batch file works just as it should, but I cannot figure out how to get rid of the error: MY FOLDER is not a recognized as an internal or...
etc.
I feel like this is an extremely simple script, and a psuedo success, as it accomplishes what I want to accomplish, but I just can't figure out how to get rid of the error.
@echo off set /p FOL=enter your folder name on "N:\GROUP NETWORK FOLDER\": set /p CMD=enter command: echo %FOL% > nul %CMD% > "\\NETWORK DRIVE\GROUP NETWORK FOLDER\%FOL%\%CMD%.TXT"