473,770 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to run a program using a Queue.

I am trying to write a little app that will perform unattended installations
of various software packages. I have a text file, each line is a string
containing the complete command to start a silent/unattended install. I
have successfully read the entire file and each line gets added to the
queue. On this line "myProcess.Star tInfo.FileName( myQ.Dequeue)" i get an
error: C:\Documents and Settings\tmoffe tt\My Documents\Visua l Studio
Projects\HandsO ff\Module1.vb(3 6): Property access must assign to the
property or use its value.

Is there a better way to go about this?
Thanks in advance.

Imports Microsoft.Win32

Imports Microsoft.Visua lBasic

Imports System.Collecti ons

Imports System.IO

Imports System.Object

' Run the program

' read the first command from the queue

' run the command

' remove the item from the queue

' set automatic login information

' reboot

' rerun the program until the queue is empty

Module HandsOff

Public Sub main()

Dim fs As New FileStream("c:\ HandsOff.txt", FileMode.OpenOr Create)

Dim sr As New StreamReader(fs )

Dim line As String

line = sr.ReadLine()

Dim myQ As New Queue

Do Until line = Nothing

myQ.Enqueue(lin e)

line = sr.ReadLine

Loop

' Displays the properties and values of the Queue.

Console.WriteLi ne("myQ")

Console.WriteLi ne(ControlChars .Tab + "Count: {0}", myQ.Count)

Console.Write(C ontrolChars.Tab + "Values:")

PrintValues(myQ )

Do While myQ.Count > 0

Dim myProcess As New Process

myProcess.Start Info.FileName(m yQ.Dequeue)

myProcess.Start ()

'Shell(myQ.Dequ eue())

'Registry hacks to enable automatic logon upon reboot

AutoLogon()

'Registry hacks to enable this program to start upon logon.

RunOnce()

'Reboot the computer.

Shell("shutdown .exe -r -f -t 05")

Loop

'Registry hacks to disable automatic logon upon reboot.

UndoAutoLogon()

End Sub
Nov 20 '05 #1
1 1548
Hi Ty,

myProcess.Start Info.FileName(m yQ.Dequeue)

StartInfo.FileN ame is a Property as mentioned in the error message. This
means that its like a variable and must be used as such (use its value
somewhere or set it).

The line above is simlar to this:
Dim sYourName
sYourName ("Ty")

I'm sure, looking at this with an ordinary string, you can see that it's
wrong and should be:
sYourName = "Ty"

Simlarly you need:
myProcess.Start Info.FileName = myQ.Dequeue

Regards,
Fergus
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2420
by: Harald Armin Massa | last post by:
I need to do some synchronisations like in a cron.job import time from threading import Thread class updater(Thread): def run(self): while True: do_updates() time.sleep(600)
2
2562
by: Nuno Magalhaes | last post by:
Why does the MessageBox.Show function in the thread below changes the program behaviour, in other words, the APListView becomes filled with values with a call to RefreshAPListView. Without the MessageBox.Show function, in my laptop, the code doesn't get past the inner loop where there is a Thread.Sleep(10). Here is the code. Does anyone know why? Thanks. private void APRun() {
0
1800
by: royal | last post by:
This problem is to simulate an airport landing and takeoff pattern. The airport has 3 runways, runway 1, runway 2 and runway 3. There are 4 landing holding patterns, two for each of the first two runways. Arriving planes will enter one of the holding pattern queues, where the queues are to be as close in size as possible. When a plane enters a holding queue, it is assigned an integer ID number and an integer giving the number of time...
2
4618
by: SammyBar | last post by:
Hi all, I'm trying to send a message from ASP.NET to another PC by using MSMQ. I created my ASP.NET project by using Visual Studio 2005 but I initially set the project to be located on the File System. Then I could successfully send, receive and purge the public queries I use to exchange information with the another PC. But when I realized I can not reach the file system created project from a third PC then I recreated the project as...
5
3422
by: shanknbake | last post by:
Here is my code. I've noted where the program crashes. I'm doing this program as a project for school. //cqueue.h file //HEADER FILE http://rafb.net/paste/results/Nh0aLB77.html -------------------------------------------------------------------- //cqueue.cpp file //IMPLEMENTATION OF cqueue CLASS http://rafb.net/paste/results/A2gXAr73.html
1
3377
by: Homeworkboy | last post by:
Can anyone help me with this program? Look at the bottom of this program for help methods: /*1. Make a program that uses numbers from 1 to 100 including each ends which puts the even integers in the front of a double linked queue and the odd numbers in the back. Then prints out the deque. 2. Make a new deque list 2 that contain integers from 51 to 100. Print that list out as mine looks. Sort that list in decending order then print...
3
1508
by: lavender | last post by:
Please help me to answer the below task!!!! The algorithm for a buffer of a printing device that will spool data sent to be printed using a queue data structure is described below. The printer has a buffer size that can hold up to 10 data in one particular time. It will only print when the queue have at least 5 data (and it will print 5 data simultaneously). Use the related operations for the queue data structure to develop this program....
0
1205
by: TwistedPair | last post by:
All, I had some great advice about this a bit ago, but I'm just not good enough with this code to put together all the pieces. The way the code below works is as a service. When it is started, it watches a folder that is set in a registry key, and if there is a file created in that folder, it copies it to a destination folder, also defined in a registry key. This works fine, for individual files, and small files, but as mentioned...
2
1565
by: slizorn | last post by:
hi guys, another problem i am facing with this program.. i have created a method to read in values from a file and store them into TreeNodes of a Tree please help me to solve the problem below.. thanks :) any help/suggestion is appreciated.. the program crashes when it reaches the following line: assign1 = searchTree(treeObj->root ,data1)->item;
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.