473,472 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Create 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.StartInfo.FileName(myQ.Dequeue)" i get an
error: C:\Documents and Settings\tmoffett\My Documents\Visual Studio
Projects\HandsOff\Module1.vb(36): 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.VisualBasic

Imports System.Collections

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.OpenOrCreate)

Dim sr As New StreamReader(fs)

Dim line As String

line = sr.ReadLine()

Dim myQ As New Queue

Do Until line = Nothing

myQ.Enqueue(line)

line = sr.ReadLine

Loop

' Displays the properties and values of the Queue.

Console.WriteLine("myQ")

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

Console.Write(ControlChars.Tab + "Values:")

PrintValues(myQ)

Do While myQ.Count > 0

Dim myProcess As New Process

myProcess.StartInfo.FileName(myQ.Dequeue)

myProcess.Start()

'Shell(myQ.Dequeue())

'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 1536
Hi Ty,

myProcess.StartInfo.FileName(myQ.Dequeue)

StartInfo.FileName 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.StartInfo.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
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
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...
0
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...
2
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...
5
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...
1
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...
3
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...
0
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,...
2
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.....
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.