Return Folder List And Their Respective Sizes?

Jul 8, 2010

I'm trying to create a simple script that will return a list of folders in the current directory and their respective sizes:

Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set strCurrentDirectory = objFSO.GetParentFolderName(Wscript.ScriptFullName)
Set objFolder = objFSO.GetFolder("strCurrentDirectory")

[Code]...

Yet it doesn't like the fact that I am trying to pass the current directory into a variable and errors out with:D:dirsize.vbs(3, 1) Erreur d'exécution Microsoft VBScript: Objet requis: '[string: "D:"]'.

View 6 Replies


ADVERTISEMENT

Folder Containg Loads Of Images Of Different Sizes?

Dec 2, 2010

ave a folder containg loads of images of different sizes and need to loop through all the files and get there size infmation so i can list them all in a treeview.

For Each f In Directory.GetFiles(imageLocation)
Dim i As Image = Nothing
Try

[code].....

View 16 Replies

Add All Files From A List To Programs Resource.folder Instead Of A Seperate Folder

Apr 14, 2009

I have made this installation program and everything work just fine, but I wish to improve it a little. Atm. all the files being installed is in a seperate folder, and the installation program simply move them to the right location.There is a builder program too.I would like it to add all files from a list to the programs resource.folder instead of a seperate folder.Atm I add the installation file to the destination folder with the following line. [code]

View 2 Replies

Add All The Files From The Selected Folder In A Folder Browser Dialog To A List Box?

Feb 6, 2010

Code so far:

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
End If
End Sub

I have managed to get drag and drop working if this is any help:

Private Sub ListBox1_DragEnter(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DragEventArgs) Handles ListBox1.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then

[code]....

View 3 Replies

VS 2010 Return Items In A List Before Returning The List?

May 23, 2012

That was probably bad title, but I'll illustrate what I'm trying to do. I have a method in a class that I need to call several times. The method returns a List(Of String). I'm just grabbing some information from a database.

VB.NET
Public Function GetTestList() As List(Of String)
Dim int As Integer = 0

[code]....

View 4 Replies

Folder Selection - Enable The User The Ability To Select A Folder And The Folders Music Files Populate A List Box

Jan 6, 2009

Basically I am trying to enable the user the ability to select a folder and the folders music files populate a list box. I want two list boxes on the page, one with all the contents of the folder and then the other one for files selected from the first box. I have no clue on how to do this at all...

View 4 Replies

Return Folder Name From File Location Path

Jun 4, 2010

How would I retrive the folder name a file is in? In this example I just want the highlighted folder name: C:Program FilesFolderNameIWantApplication.exe I can get the path excluding the file using various methods such as:

[Code]...

View 4 Replies

List Of T Find Date Or Other Property In A Object In The List - Then Return Found Object?

Sep 3, 2009

After reading all the examples for list of T exists and Find and find first, none show how to handle multi-property objects. Below is bare bones example maybe someone could flesh out to show how this should be done.

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim DatePriceList As New List(Of DateAndPrice)
DatePriceList.Add(New DateAndPrice(Date.Parse("1/1/2000"), 10.12))
DatePriceList.Add(New DateAndPrice(Date.Parse("1/2/2000"), 11.12))

[Code]...

View 3 Replies

Create Css For Respective Xml File?

Mar 4, 2009

I have design code for access to xml migration.It is working.but facing one queryI need to attach CSS to xml , thus how can i write the code in vb.net to create css for respective xml file

View 2 Replies

Array To Store Contain In Respective Nodes

Apr 18, 2011

i've a treeview in my project form which look like this.[code]The user will be able to upload their pages to the respective pages nodes and I am suppose to make it in such a way that after the user uploaded the cover page which is showing at the PictureBox1 which I've use to display the image, and when he uploads the second page image at the PictureBox1, the Cover page image that he uploaded earlier on will not be overwrite.I was told to create class and use array to store the contain in the respective nodes but I do not have any idea how to do it.Is there any other ways about solving this problem? I'm using Visual Studio 2008 vb.net.

View 2 Replies

Split The Given Dates And Add It To Their Respective Quarter?

Apr 3, 2012

I want to find the Quarter date time values for my exampleSuppose I have selected this two date and I want to split it by quarter date

Start Date : 11/21/2010
End Date : 04/14/2012
I want the below result from the above date:

[code].....

View 3 Replies

Return A List Of Type T?

Jun 22, 2010

I would like to have a function(of T) that returns a list(of T) that is assignable to a variable of list(of T).For Example:

the variable:
Private _StandardCodes As List(Of StandardCode)
the assignment:[code]....

I'm getting the error "Type paramater 'T' for ... cannot be inferred", as a result I have to use a comparable function to return a list(of Object) and then do:

_StandardCodes = (From x In AMExtensions.queryObject(GetType(StandardCode), "StandardCode") _
Select CType(x, StandardCode)).ToList

View 5 Replies

Return The Array List?

Feb 6, 2009

I am having a little trouble trying to use an array list. I am using a function that I want to return the array list. However, I am having a problem getting it to return the arraylist. when i do this:

[Code].....

View 5 Replies

Open A File With Its Respective Application In Progra

Mar 2, 2010

I need to open any kind of file with its respective application from vb.net code, just like when we double click a file in windows it gets opened with its appl,like a WORD file with MSWORD, .xls file with MSEXCEL etc

View 1 Replies

.net - Function To Accept List(Of String), Array & String And Similarly Return List(Of String)?

Jul 29, 2011

I want the Function to accept List(Of String), Array & String and similarly return List(Of String), Array & String respectively. The Function simply adds a string (month) to the input collection. I just want to use it for string, array and list with needing to think of conversions.

[Code]...

View 2 Replies

Filter A Dictionary To Return A List?

Apr 23, 2012

I know I can do this with a for loop cause that's how i'm doing it now. I was hoping for a more efficient way to accomplish the task.

I have a dictionary(Of Integer, Boolean) or Of String, Boolean. i want to get a list(of integer) or Of String from the dictionary where all the values are true(or false depending on what i need at the time)

and to generalize it or "black box" it, it could be any dictionary(of whatever, whatever) and return a list(of whatever) where the value = whatever i'm looking for at the time.

string, string where value = "Closed"

in short: i want all list of all the keys who's value = some criteria

my current code:

Public Function FindInDict(Of tx, ty)(thedict As Dictionary(Of tx, ty), criteria As ty) As List(Of tx)
Dim tmpList As New List(Of tx)

[Code].....

View 2 Replies

Return A List From A Compiled Query?

May 8, 2009

I was speeding up my app by using compiled queries for queries which were getting hit over and over.I tried to implement it like this:

Function Select(ByVal fk_id As Integer) As List(SomeEntity)
Using db As New DataContext()
db.ObjectTrackingEnabled = False

[code].....

View 1 Replies

Return All Keys With A Certain Value From A List Of KeyValuePair?

Oct 27, 2009

Given the following vb.net class:

Friend Class PairCollection(Of TKey, TValue)
Inherits List(Of KeyValuePair(Of TKey, TValue))
Public Overloads Sub Add(ByVal key As TKey, ByVal value As TValue)
Me.Add(New KeyValuePair(Of TKey, TValue)(key, value))
End Sub

[Code]...

View 1 Replies

Return List After Sorting With Repeater?

Jan 5, 2012

I have a list going into a repeater, sorting with jquery sortable(), and then need to put the sorted list into a session variable. I cannot seem to figure out how to get the sorted values back into a list.[code]...

View 1 Replies

Return Text Of An Item From A List Box?

Aug 8, 2010

I wish to get the Text of item where I know its index! most of the codes I have founds Return the index number not the text it self!

View 5 Replies

Use A Function To Return A List Of Strings?

Oct 5, 2011

Update: I didn't make it clear but I meant this to be a question about where/how I would use a function to return a list of strings when I'm trying to just work with classes.I have a class called Account.

I have data access class called AccountDAO.I have various functions that return lists of objects like GetAllAccounts, GetAccountByID etc.I want to populate a drop down list with just the account names and nothing else. It's proving rather slow when using lists of objects and databinding them to the dropdownlist.

I feel like I should be using a simple "Select Account_Name From blah" type statement and returning a list of strings but I don't know how to work this into my class and data access class.

View 4 Replies

Why Can't Return A List From A Compiled Query

Mar 9, 2010

I was speeding up my app by using compiled queries for queries which were getting hit over and over.

I tried to implement it like this:

Function Select(ByVal fk_id As Integer) As List(SomeEntity)
Using db As New DataContext()
db.ObjectTrackingEnabled = False

[Code].....

View 1 Replies

Select The Type Of Entry Which Opens The Respective Form?

Jul 21, 2009

I am using VS 2008/VB with Access 2007. I have 2 forms that I use to create entries. In the first form (fomr1) I select the type of entry which opens the respective form (form. In form1 I use some code to read through a oledbreader the id rows and get the max value in that column. I take that value and I add 1 to it and then assign the value to a textbox in form2. The whole process worked fine until today which gives me this exception "An error occurred creating the form. See exception.innerexception for details. The error is Object reference not set to an instance of an object. "

[Code]...

View 17 Replies

List.Contains Returns False, Even Though It Seems It Should Return True?

Feb 17, 2010

Sub pageload() Handles Me.Load
Dim bom As New List(Of Car)
Dim car1 As New Car With {.Name = "Pea", .Year = 2}[cod

WHY??? I mean the object has the exactly same data, so why does itee]..... say it is not contained?

View 3 Replies

Function To Return A List For A Dropdownlist Or Combobox?

Aug 27, 2009

I have written a function before to delete and update records, but never anything to return values back to my call of the function. Here is my code, and I will try to explain what I'm trying to acheive.

If Not Att1 = "" Then
Attribute1.Text = Att1
Attribute1.Visible = True
ComboBox1.Visible = True

[code]....

That codes goes on up to att20. It works just fine, but it is forever long, and I would like to clean it up.I want to do something like:

Or, should I pass the combobox number also, so that the code can fill the appropriate combobox? Like.comboboxfill(Att1,Combobox1) how to write the function and how to pass back the information or just how to make it work in general?

View 6 Replies

Group List And Return Only Cheapest One For Each Provider

Feb 2, 2012

I have an object called offer and it has sub object price as decimal and provider_ID as integer. What I need is I have list (of offer) and I need to get cheapest price for each provider. So lets says I have following:

Provide_ID Price
----------------------
1 30
2 40
1 15
2 20
3 5
3 10

How can I make a linq query (from item in offers group by item.provider_id into
max(item.price)) like this.
Because using group by I am not able to get all information of offer object. beside provider_ID and price I have more information. That's why I don't want to have (with {item.price, item.provider_ID}) etc. selecting each one by one.

And results of filtering should have only
provide_ID Price
----------------------
1 15
2 20
3 5

View 5 Replies

How To Read Two XML Files And Return List (of Objects)

Jun 20, 2011

I have two xml files. I have to read them and return as a List( Of object). Here is my function.
Public Function GetData(ByVal name As String, ByVal city As String) As List(Of Object)
'Return Nothing
End Function

View 1 Replies

Linq Return Results Contaiined In A List?

Mar 23, 2011

How can i select using linq from a datatable where the the only results I want back (ID's) are contained in a list of integers?

View 7 Replies

Return List Of String That An Object A Has Username

Dec 2, 2010

How to return Ilist of strin that object a has username i want return that name

View 1 Replies

Sending Mail To Individual Users Attaching Respective Files

Sep 25, 2009

My requirement is that, I have a folder containing some pdf files. These files are named as 1,2,3 ..so on. I have a table where I store the pdf file name with a user

E.g.:
userid|fileid|emailId
1|1|A@A.COM
2|2|B@B.COM
3|3|C@C.COM

I need a vb code (preferably) to send a mail to all the users with appropriate file associated to them meaning each user will get a mail containing one file which was assigned to him.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved