shell - Create with pipe a user defined filename batch file -


i want read stdin filename batch file need create. in single line , using pipe. when try cmd creating .bat before put in name.

set /p filename= | copy nul %a%.bat 

that's not how pipe works. pipe takes output of previous command, , makes input of next command. set /p filename= command doesn't produce output, copy nul %a%.bat doesn't input, that's irrelevant anyway, because copy command doesn't take input anyway. copy nul %a%.bat command creates empty file called .bat because haven't defined variable called a, , %a% gets expanded empty string.

what want requires 2 commands:

set /p filename= copy nul %filename%.bat 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -