batch file - how to use input in cmd -
i wrote script in cmd (*.cmd) copy file ftp server, working , fine. code:
@echo off # put command lines in txt file echo cd wf/721/pages >> temp.txt echo put c:\users\tc99670\desktop\tempwf\721\pages\channel.json >> temp.txt echo put c:\users\tc99670\desktop\tempwf\721\pages\main-screen.json >> temp.txt echo put c:\users\tc99670\desktop\tempwf\721\pages\settings.json >> temp.txt echo put c:\users\tc99670\desktop\tempwf\721\pages\wihow usefi.json >> temp.txt echo quit >> temp.txt # connect ftp , running command in txt file ftp -n -s:temp.txt 150.42.40.221 # deleting txt file del temp.txt its working great when tried add user input option not working more:
@echo off set /p path=enter path: echo cd wf/721/pages >> temp.txt echo put %path%\721\pages\channel.json >> temp.txt echo put %path%\721\pages\main-screen.json >> temp.txt echo put %path%\721\pages\settings.json >> temp.txt echo put %path%\721\pages\wifi.json >> temp.txt echo quit >> temp.txt ftp -n -s:temp.txt 150.42.40.221 del temp.txt i dont know went wrong, :)
do not use path variable name...
...it system variable tells cmd programs. change path in script else, such inputpath.
Comments
Post a Comment