diff --git a/reactos/base/applications/network/dwnl/dwnl.c b/reactos/base/applications/network/dwnl/dwnl.c new file mode 100644 index 00000000000..2880cf46d42 --- /dev/null +++ b/reactos/base/applications/network/dwnl/dwnl.c @@ -0,0 +1,47 @@ +#include +#include +#include + +HRESULT WINAPI URLDownloadToFileA( + LPUNKNOWN pCaller, + LPCSTR szURL, + LPCSTR szFileName, + DWORD dwReserved, + LPBINDSTATUSCALLBACK lpfnCB); + +// ToDo: Show status, get file name from webserver, better error reporting + +int tmain(int argc, TCHAR **argv) +{ + int i; + + if(argc != 2) + { + _tprintf(TEXT("Usage: dwnl ")); + return 2; + } + + TCHAR* filename = argv[1]; + for(i=_tcslen(argv[1]);i>0 + &&filename[i]!='/' + &&filename[i]!='\\' + &&filename[i]!='?' + &&filename[i]!='*' + &&filename[i]!=':' + &&filename[i]!='\"' + &&filename[i]!='<' + &&filename[i]!='>' + &&filename[i]!='|';i--); + filename = &argv[1][i+1]; + + _tprintf("Downloading %s... ", filename); + + if(URLDownloadToFileA(NULL, argv[1], filename, 0, NULL) != S_OK) + { + _tprintf("Failed.\n"); + return 1; + } + + _tprintf("Finished.\n"); + return 0; +} diff --git a/reactos/base/applications/network/dwnl/dwnl.rbuild b/reactos/base/applications/network/dwnl/dwnl.rbuild new file mode 100644 index 00000000000..2e8131b2180 --- /dev/null +++ b/reactos/base/applications/network/dwnl/dwnl.rbuild @@ -0,0 +1,12 @@ + + + + . + kernel32 + crtdll + urlmon + + 0x0501 + + + +