简体   繁体   English

Powershell位传输

[英]Powershell Bitstransfer

I just wanted to write a script, that automates file downloading for me, to keep the files up to date. 我只是想编写一个脚本,为我自动执行文件下载,以使文件保持最新。

I can download .pdf,.txt and so on from different websites, but I can't manage to download an .exe from a specific website. 我可以从不同的网站下载.pdf,.txt等,但是我无法从特定的网站下载.exe。 Though I can download the .exe via my browser without any problems. 尽管我可以通过浏览器下载.exe,但没有任何问题。

I start the script in the powershell(started as administrator). 我在Powershell中启动脚本(以管理员身份启动)。 Then it says Connections, but it doesn't connect. 然后显示“连接”,但未连接。 So the progression bar, doesn't change. 因此进度条不会改变。 Then after a few seconds it stops and i get my prompt back. 然后几秒钟后,它停止了,我得到了提示。

It does create a file but it's 0b big. 它确实创建了一个文件,但是它的大小为0b。

This is my scrip: 这是我的书信:

Import-Module BitsTransfer 
Start-BitsTransfer -Source http://media.kaspersky.com/utilities/VirusUtilities/EN/rectordecryptor.exe `
-Destination S:\Programme\Antiviren\rector.exe

The script works, it sound more like a permissions issue 该脚本有效,听起来更像是权限问题

Do you or the account ( if scheduled task) have write access to the folder S:\\Programme\\Antiviren\\ also Check if folder is read only 您或帐户(如果已计划任务)是否具有对文件夹S:\\ Programme \\ Antiviren \\的写访问权,并且还检查文件夹是否为只读

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM