T
Ty Moffett
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
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