Jump to content
Sign in to follow this  

Bitsadmin job creation issues

Recommended Posts

I cannot get it to run inside of autoit. If I take the same command and dump it in a console it works fine. What am I missing?


Func BitsJob() ;Checks if job is running and creates it if it is not
 If Not FileExists("C:bitstransferLibreOfficeLibreOfficePortable.exe") Then
  RunWait(@ComSpec & " /c 'bitsadmin.exe /create libre", @SW_HIDE)
  RunWait(@ComSpec & " /c bitsadmin.exe /addfile libre$libreLibreOfficePortable.exe c:bitstransferLibreOfficeLibreOfficePortable.exe", @SW_HIDE)
  RunWait(@ComSpec & " /c bitsadmin.exe /resume libre", @SW_HIDE)
  If FileExists("C:bitstransferLibreOfficeLibreOfficePortable.exe") Then
EndFunc   ;==>BitsJob
Func BitsAdminCheck() ; Bitsadmin verify and install if needed
 If Not FileExists("C:\Windows\System32\bitsadmin.exe") Then
  FileInstall("C:scriptsbitsinstallerbitsadmin.exe", "C:\Windows\System32\bitsadmin.exe", 1)
 ElseIf FileExists("C:\Windows\System32\bitsadmin.exe") Then
EndFunc   ;==>BitsAdminCheck
Func DirSetup() ; Creates the dir to copy file or files on workstation
 Local $sFldr1 = "C:bitstransfer"
 Local $sFldr2 = "C:bitstransferLibreOffice"
 If DirGetSize($sFldr2) <= 0 Then
EndFunc   ;==>DirSetup
Func Inst_LibOff()
 ;script to install libre
EndFunc   ;==>Inst_LibOff

Share this post

Link to post
Share on other sites

I cannot even get this to run

RunWait("C:\Windows\System32\bitsadmin.exe /create libre", @SW_SHOW)

Forgot to mention I am running this on XP but hope to run it on Win7 as well.

AutoIt version is if that matters.

Share this post

Link to post
Share on other sites

That line is different than in your script where it has an extra ' character.

Also see you are missing a backslash after on the next line.

What is the working directory when you run the commands manually in a CMD window?

Are you running under Admin credentials and have you tried #RequireAdmin?


edit: Tested with this single line and worked fine for me:

RunWait(@ComSpec & " /k bitsadmin.exe /create libre")
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...