说网址错误,但对我来说似乎是正确的。我正在尝试从互联网下载文件启动该程序,然后在该过程结束后删除该程序。任何帮助都会很棒
过程将是
启动exe ---> 创建简单的下载器 ---> 通过bat文件添加参数 ---> 启动文件 ---> 等待进程结束 ---> 删除下载的文件。我还没有添加等待进程和删除命令
@if (@X)==(@Y) @end /****** jscript comment ******
@echo off
::::::::::::::::::::::::::::::::::::
::: compile the script ::::
::::::::::::::::::::::::::::::::::::
setlocal
if exist simpledownloader.exe goto :skip_compilation
set "frm=%SystemRoot%\Microsoft.NET\Framework\"
:: searching the latest installed .net framework
for /f "tokens=* delims=" %%v in ('dir /b /s /a:d /o:-n "%SystemRoot%\Microsoft.NET\Framework\v*"') do (
if exist "%%v\jsc.exe" (
rem :: the javascript.net compiler
set "jsc=%%~dpsnfxv\jsc.exe"
goto :break_loop
)
)
echo jsc.exe not found && exit /b 0
:break_loop
call %jsc% /nologo /out:"simpledownloader.exe" "%~dpsfnx0"
::::::::::::::::::::::::::::::::::::
::: end of compilation ::::
::::::::::::::::::::::::::::::::::::
:skip_compilation
:: download the file
::
::::::::::
:: simpledownloader.exe "%%~1" "%%~2"
simpledownloader.exe "https://download.splashtop.com/sos/SplashtopSOS.exe" sos.exe
sos.exe
:: del /q simpledownloader.exe
::
::::::::
::
exit /b 0
****** end of jscript comment ******/
import System;
var arguments:String[] = Environment.GetCommandLineArgs();
var webClient:System.Net.WebClient = new System.Net.WebClient();
print("Downloading " + arguments[1] + " to " + arguments[2]);
try {
webClient.DownloadFile(arguments[1], arguments[2]);
} catch (e) {
Console.BackgroundColor = ConsoleColor.Green;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\n\nProblem with downloading " + arguments[1] + " to " + arguments[2] + "Check if the internet address is valid");
Console.ResetColor();
Environment.Exit(5);
}
泛舟湖上清波郎朗
相关分类