Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to set up a daily scheduled download of files from an external web-server, using WGET, Windows' task-scheduler and command-scripts.

Since WGET will be run on a server from within the company's internal network, it has to first connect through our HTTP-proxy server, which requires proxy-authentication (HTTP 407), and then when the external web-server is reached, it too also requires authentication (HTTP 401), before the files can be downloaded.

Now this all works, using the following command-line, which unfortunatly contains visible passwords in the command-script:

wget.exe -e http_proxy=http://company-proxy:80
         --proxy-user=PROXYUSER --proxy-password=PROXYPASSWORD 
         --http-user=HTTPUSER --http-password=HTTPPASSWORD
         "http://www.example.com/folder/FileToDownload.txt"

Since the scheduled-task, that is starting WGET (or command-script), has to run as PROXYUSER with PROXYPASSWORD, I was wondering if it is possible to somehow read or give these values to the --proxy.. arguments of WGET, and not having them in plain sight within the command-line/-script?

E.g.

wget.exe --proxy-user=<Get_User_From_ScheduledTask> 
         --proxy-password=<Get_Password_From_ScheduledTask>
         ...

Or alternatively, from a Windows command-script, is there a way to "programmatically read" values (stored in some kind of registry-database or "vault"), that only the run as user will have access to?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

i think wgetrc will solve your problem.

look here and here.

share|improve this answer
    
Hmm yes, I guess an ACL protected wgetrc file, passed as parameter from the scheduled task to WGET, would be the proper solution. –  DeckerDK Aug 10 '09 at 11:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.