.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 9th, 2010, 08:58 PM
BarrySDCA BarrySDCA is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2010
Posts: 1 BarrySDCA User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 18 sec
Reputation Power: 0
BITS download via WMI in VB.NET - HELLLLLLLP!

can someone please tell me what is wrong with this code? I get an "invalid parameter" error back from wmi. just trying to download a file via BITS. thank you

.
.
.
Imports System
Imports System.Text
Imports System.IO
Imports System.Management
Imports System.Management.Automation
Imports System.Management.Automation.Runspaces
Imports System.Management.Automation.Runspaces.RunspaceFac tory
Imports System.Collections.ObjectModel
.
.
.

Try

Dim classInstance As New ManagementObject("root\Microsoft\BITS\", "BitsClientJob", Nothing)



' Obtain [in] parameters for the method
Dim inParams As ManagementBaseObject = classInstance.GetMethodParameters("CreateJob")


' Add the input parameters.

inParams("DisplayName") = "test"
inParams("LocalFile") = "c:\test.zip"
inParams("RemoteUrl") = "http://myinternaltestbox/test.zip"


' Execute the method and obtain the return values.
Dim outParams As ManagementBaseObject = classInstance.InvokeMethod("CreateJob", inParams, Nothing)

' List outParams
txtResult.Text = "JobId: {0}" & outParams("JobId") & vbCrLf
txtResult.Text = txtResult.Text & "ReturnValue: {0}" & outParams("ReturnValue")

Catch err As ManagementException

MessageBox.Show("An error occurred while trying to execute the WMI method: " & err.Message)
End Try

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > BITS download via WMI in VB.NET - HELLLLLLLP!


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap