Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Automated Installations

$
0
0
Hi and Welcome.

First of all I'm using VB 2008 express and Visual Studio (VB Console Application) 2013.

Now here's my problem. I have an installer of a certain printer which is saved in C: in my computer. Now I want to develop a vb script using the above mentioned application (VB 2008 express and VS 2013) to automate it. Here's a step by step explanation,

1. if I click the application that I will make using above mentioned programs, the printer driver will run.
2. The script will click Next or "%N" or "%A" or to make it short to press the keys needed to proceed from one step to another.
3. There a part of the installer wherein it will ask the user for the version of his/her operating system (a radio button with description on the side). ( so I want this to be automated as well by letting the vb script check for the version of OS installed in his/her computer.)
4. That's it. I will now paste what I have created so far and hope someone will help me.

**Reminder**

This is what I want so please respect my post and don't comment about doing it using silent installation.


Here's my code:


(Please check if this is correct and help me out)

Module Module1
SubMain()
Dim shell As WshShell = New WshShell
Dim MyPath As String = "C:\"
Dim File As Integer = shell.Run(MyPath)
Dim OSS as String = ("Windows 7","windows vista","windows xp")

shell.sleep (2000)
shell.sendkeys ("%n")
shell.sleep (2000)
shell.sendkeys ("%a")
shell.sleep (2000)
shell.sendkeys ("%n")
shell.sleep (2000)
shell.sendkeys ("{ENTER}")


//I dont know if this is correct but please check and correct it for me//
for each OS


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
Wscript.Echo objOperatingSystem.Caption & " " & _
objOperatingSystem.Version
Next


shell.sleep (2000)
shell.sendkeys ("%n")

Shell.Echo ("Complete")
Shell.Quit()

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>