Windows Bitsadmin Alternative - batch-file

because Bitsadmin is getting deprecated I would like to hear if you know about an alternative to Download files from within a batch script.
Best would be an alternative that already comes with windows so I don't need to download extra stuff.

Bacon Bits and I had the same idea at the same time. Here's an example using PowerShell's BitsTransfer module. Save this as a .bat file and run it.
#echo off
setlocal
set "URL=http://cdn.sstatic.net/stackoverflow/img/sprites.svg"
set "SaveAs=sprites.svg"
powershell "Import-Module BitsTransfer; Start-BitsTransfer '%URL%' '%SaveAs%'"

Good news -- BitsAdmin isn't being deprecated.
(I work for the BITS team at Microsoft)

The best alternative to BITSAdmin.exe is to use PowerShell.
If you cannot use PowerShell, you're pretty much stuck with copy, xcopy.exe, and robocopy.exe.

How can I download a file with batch file without using any external tools? - you can check this
Probably the powershell is the best alternative Though you still can find vista and XP machines without powershell - if portability is important for you
go to WSH.
.I don't think MSXML2.XMLHTTP and WinHTTPRequest (here I've a little bit more powerful tool based on winhttprequest - and more tested ) are going to be deprecated any time soon but they will require WSH or jscript or vbscript or powershell.
jscript.net and webclient will work better for bigger files.

Related

How do I save chromepass data via batch file?

I tried to save the data from chromepass with /stext command, which should work according to their site.
Code:
Start chromepass.exe /stext chromepass.txt
You might be using the version that has no support for command line.
Command-line options removed from the official release of my password-recovery tools, it's constantly detected by many Antivirus programs as malware/Trojan/Virus or as a security risk.
According to his blog
You can find a version with command line supported here.
Hope this was helpful to you :)

Possibly to run silent and verysilent from within the application

Is it possible to run the silent and verysilent option from within the inno setup application.That is as soon as I clicked the exe it will run with verysilent option (no need to provide it in the command prompt)
I have figured out the temporary way of putting the command with verysilent option in the batch script and clicking the batch script :) !
It is Bad Formâ„¢ make a "covert" installer. From Inno's FAQ:
Is it possible to do a silent install without using the /SILENT or /VERYSILENT command-line parameters?
No, nor is such a feature planned (it would be abused). If it is your intention to keep user interaction to a minimum, use the Disable* [Setup] section directives.
This would only matter if you are actually building the installer. If you're just trying to install the application, the only sensible thing to do is use the command-line flags in a batch file (or other scripting language).

Batch file / powershell: downloading and silent installing script

I am trying to write a script that will, ideally, download the .exe/.msi files for different programs, and run them silently. These installations do usually require input, like clicking next, or check a radio button. If I know what installation settings I want to run, how can I get these installations to run them in the way I want, but silently? Will the coding be simplier to do using batch programming or using Powershell? (I am a complete beginner to both, so no preference. Suggestions would be much appreciated). The script would ideally then be packaged up into it's own .exe file to run on any windows computer.
Downloading the Installers
This is the easy part. In PowerShell 3 or newer, you can download via Invoke-WebRequest:
Invoke-WebRequest 'http://example.com/installer.exe' -OutFile 'installer.exe'
In earlier versions, you can create a WebClient object and use its DownloadFile method:
$Client = New-Object System.Net.WebClient
$Client.DownloadFile('http://example.com/installer.exe', 'installer.exe')
If you had a text file listing all the installers you needed to download, one URL per line, you could download them all like so:
Get-Content 'installers.txt' | % { Invoke-WebRequest $_ -OutFile ($_ -replace '^.*?([^/]+$)', '$1') }
Running the Installers
This is the hard(er) part. Automating UIs is messy in general, and PowerShell doesn't go out of its way to support it. It can be done with the .NET Framework, but PowerShell is really better suited for manipulating data directly.
If you have to do UI automation, though, I'd recommend an alternative like AutoIt. AutoIt is a kind of mashup of VBScript, PowerShell, and a few other languages that makes it easy to do things like click buttons and enter text into text boxes automatically. It's commonly used to automate GUI installations.
Alternatively, consider repackaging the EXE installers as MSIs before deployment. MSIs are made for silent installs. Their property values can be self-contained (or stored in MST files) so that a user doesn't have to type them in at runtime, so there's no need to automate their UIs. Smart Package Community Edition (formerly WinInstall LE) is freeware that can scan the files and registry entries created by an installer and package them into an MSI file for you.
Hope this helps!
Another option is to use Chocolatey, but that depends on whether the required applications are already packaged (you can package your own as well, provided there are no licensing or redistribution limitations).

xcopy from online storage

Is there any way to copy some files from an internal online storage to a local drive by using a *.bat-file on Windows XP?
Due to some strange internal restrictions I am only allowed to use a *.bat-file to do this.
The path to the files, which are to be copied, is kinda "http://files.in-house/section/linkages"
So I tried xcopy (xcopy goto.in-house/section/linkages U:\linkages) in any variations, with quotation marks, without etc. but it does not work
a) is there any way to do this?
b) how?
Very similar to a question asked on SuperUser.com, here. The accepted answer uses vbscript, which is not installed in all WinXP systems. To check if you have it, just type cscript at a command line prompt. If you need to download it, it's here.
The number two answer relies on bitsadmin, which is not part of XP, but can be obtained with the Windows XP Service Pack 2 Support Tools.

run bat file in background

I want to run a bat file in background. I searched in google and I found some examples using hstart and cmdow. But Isn't anyway to do this with windows commands? I really feal good when I don't add extra programs to my project !
thanx in advance
I'm using window scheduler. I found a way :
Save this one line of text as file invisible.vbs:
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
To run any program or batch file invisibly, use it like this:
wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"
thanx
It really depends on the programming language and platform you are using.
In Windows, using the C# language on the .NET platform, it is:
System.Diagnostics.Process.Start(#"C:\myfile.bat");
You can try to run the batch file as a windows service. You will perhaps need to have admin previleges on your host to do this, but if you want to go for it, its easy to add/configure using sc command.

Resources