Answer the question
In order to leave comments, you need to log in
Why do the files created by the script disappear?
Good afternoon!
Is on the server on Windows 2008 R2. It is necessary to upload exchange rates to it daily from the website of the Central Bank. I made a powershell script that loads them in xml format:
Function Get-Webclient ($url, $out) {
$proxy = [System.Net.WebRequest]::GetSystemWebProxy()
$proxy.Credentials = [System.Net.CredentialCache ]::DefaultCredentials
$request = New-Object System.Net.WebCLient
$request.UseDefaultCredentials = $true ## Proxy credentials only
$request.Proxy.Credentials = $request.Credentials
$request.DownloadFile($url, $out)
}
Get-Webclient " www.cbr.ru/scripts/XML_dynamic.asp?date_req1=11/02... " "C:\temp\R01035.xml"
Get-Webclient "www.cbr.ru/scripts/XML_dynamic.asp?date_req1=11/02... " "C:\temp\R01215.xml"
Get-Webclient " www.cbr.ru/scripts/XML_dynamic.asp?date_req1=11 /02... " "C:\temp\R01235.xml"
Get-Webclient " www.cbr.ru/scripts/XML_dynamic.asp?date_req1=11/02... " "C:\temp\R01239.xml "
Get-Webclient" www.cbr.ru/scripts/XML_dynamic.asp?date_req1=11/02... ""C:\temp\R01775.xml"
The result should be 4 files in the c:\temp folder
. on its own behalf, running on behalf of a special account - everything works correctly, files are created.
But, as soon as this task is launched from the scheduler under the same specialized account, files are created and disappear. Why? What needs to be done so that they do not disappear?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question