当我使用 ftp 时 Cmd 做奇怪的事情
Cmd doing weird things when i use ftp
这是我的批处理脚本
@echo on
if not [%1]==[] GOTO :copy_file
if [%1]==[] GOTO :open_folder
:copy_file
echo open 95.105.195.45 > temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo user bukvicak pk3027fr >> temp.txt
echo put %1 >> temp.txt
echo quit >> temp.txt
ftp -s:temp.txt
del temp.txt
del %1
GOTO :end
:open_folder
%SystemRoot%\explorer.exe "C:\Users\Igor\AppData\Roaming\Microsoft\Windows\Network Shortcuts.105.195.45"
GOTO :end
:end
exit
今天早上脚本运行良好,现在当我启动它时,它将在执行 "ftp -s:temp.txt"
后开始这个循环
它是自动拖放移动文件到 ftp 服务器的脚本。现在,当我在任何其他脚本中使用 ftp 命令时,它将从屏幕截图开始循环。但是当我将脚本复制到另一台 PC 时,它工作正常。或者当我通过 CMD 启动它时它也工作正常。
抱歉我的英语不好
有人可以帮助我吗?非常感谢
您的批处理文件名为 ftp.bat
或 ftp.cmd
,当它到达行 ftp -s:temp.txt
时,它会调用自己
将批处理文件重命名为其他名称或使用 ftp.exe -s:temp.txt
这是我的批处理脚本
@echo on
if not [%1]==[] GOTO :copy_file
if [%1]==[] GOTO :open_folder
:copy_file
echo open 95.105.195.45 > temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo nope >> temp.txt
echo user bukvicak pk3027fr >> temp.txt
echo put %1 >> temp.txt
echo quit >> temp.txt
ftp -s:temp.txt
del temp.txt
del %1
GOTO :end
:open_folder
%SystemRoot%\explorer.exe "C:\Users\Igor\AppData\Roaming\Microsoft\Windows\Network Shortcuts.105.195.45"
GOTO :end
:end
exit
今天早上脚本运行良好,现在当我启动它时,它将在执行 "ftp -s:temp.txt"
后开始这个循环它是自动拖放移动文件到 ftp 服务器的脚本。现在,当我在任何其他脚本中使用 ftp 命令时,它将从屏幕截图开始循环。但是当我将脚本复制到另一台 PC 时,它工作正常。或者当我通过 CMD 启动它时它也工作正常。
抱歉我的英语不好
有人可以帮助我吗?非常感谢
您的批处理文件名为 ftp.bat
或 ftp.cmd
,当它到达行 ftp -s:temp.txt
时,它会调用自己
将批处理文件重命名为其他名称或使用 ftp.exe -s:temp.txt