Solved

Software checklist hta thats store into a ini file.

Posted on 2010-08-19
7
999 Views
Last Modified: 2012-06-22
Hi,

Software checklist

I have a txt file with 1000's of software names per line. I want a hta to read from the txt file and show the names and each line should have a checkbox at the end. To select if software available or now as dump another checkbox CD and another checkbox downloadable

So 3 checkboxes and 2 buttons select all and select none.
Submit button when selected saves the selections in a ini file and when opened again gets the data from that ini and displays and again we can make any changes and submit.

regards
Sharath
0
Comment
Question by:bsharath
7 Comments
 
LVL 3

Expert Comment

by:kooswillem
ID: 33483056
So, and now we're suppose to start programming for you?

Why do you start trying to solve the problem yourself and when you run into a problem, tell us the problem , give us a sample of the list, and we will answer the question.
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 33490120
^^^^^

+1

~bp
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 33539262
Sharath, it's a bit unclear what you want from this, but this should be a start......it reads from applications.ini

Regards,

Rob.
<html>
<head>
<hta:application
	ID="Software Checklist"
	ApplicationName="Software Checklist"
	SINGLEINSTANCE="YES"
	CONTEXTMENU="NO"
	MINIMIZEBUTTON="NO"
	MAXIMIZEBUTTON="NO"
	SCROLL="NO"
	BORDER="THIN"
	ICON=""
/>

<head>

<script language="vbscript">

window.resizeTo 800,600

Dim intAppCount

Sub Window_OnLoad
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Const intForReading = 1
    If Mid(document.location, 6, 3) = "///" Then
    	strHTAPath = Mid(Replace(Replace(document.location, "%20", " "), "/", "\"), 9)
    Else
    	strHTAPath = Mid(Replace(Replace(document.location, "%20", " "), "/", "\"), 6)
    End If
    strHTAPath = Left(strHTAPath, InStrRev(strHTAPath, "\"))
	strApplications = strHTAPath & "Applications.ini"
	
	Set objApps = objFSO.OpenTextFile(strApplications, intForReading, False)
	
	intCurrentOption = 0
	strOptions = "<table border=1><tr><th width=60%>Software Title</th><th>Available</th><th>On CD</th><th>Downloadable</th>"
	While Not objApps.AtEndOfStream
		strApp = Trim(objApps.ReadLine)
		If strApp <> "" Then
			intCurrentOption = intCurrentOption + 1
			strOptions = strOptions & "<tr><td>" & strApp & "</td>" &_
				"<td><input type='checkbox' id='chkAvailable' " &_
				"name='chkAvailable' value='" & strApp & "' " &_
				"checked=True></td>" &_
				"<td><input type='checkbox' id='chkOnCD' " &_
				"name='chkOnCD' value='" & strApp & "' " &_
				"checked=True></td>" &_
				"<td><input type='checkbox' id='chkDownloadable' " &_
				"name='chkDownloadable' value='" & strApp & "' " &_
				"checked=True></td></tr>"
		End If
	Wend
	objApps.Close
	strOptions = strOptions & "</table>"
	DataArea.InnerHTML = strOptions
	intAppCount = intCurrentOption
End Sub

Sub SelectAll
	For Each objCheckBox In chkAvailable
		objCheckBox.Checked = True
	Next
	For Each objCheckBox In chkOnCD
		objCheckBox.Checked = True
	Next
	For Each objCheckBox In chkDownloadable
		objCheckBox.Checked = True
	Next
End Sub

Sub DeselectAll
	For Each objCheckBox In chkAvailable
		objCheckBox.Checked = False
	Next
	For Each objCheckBox In chkOnCD
		objCheckBox.Checked = False
	Next
	For Each objCheckBox In chkDownloadable
		objCheckBox.Checked = False
	Next
End Sub
</script>

<style>
body
{
	font: 10pt Arial;
	background-color: buttonface;
	border: none;
}

td {
	font: 10pt Arial;
}

td.link {
	cursor: hand;
	color: blue;
	width: 200px;
}
table {
	margin-left: 50px;
}
</style>

</head>

<body>

<div id="DataArea"></div>

<table>
<tr>
<td width="50%">
<input type='button' value='Select All' name='btnSelectAll'  onClick='vbs:SelectAll'>
</td>
<td>
<input type='button' value='Deselect All' name='btnDeselectAll'  onClick='vbs:DeselectAll'>
</td>
</tr>
</table>

</body>

</html>

Open in new window

0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 11

Author Comment

by:bsharath
ID: 33539293
Thanks Rob

Its basically going to have all the software names available in the domain.

Say we have 3000 different softwares. I will have them in the ini file. I will email this to the team and every one has a different set of softwares under their control
When i open the HTA for the first time. I will need all unchecked. And say i know that 10 software are downloadable and 5 i have the dump. Then i select this and click on Submit.
The my selection has to be saved into a file. Say another user opens the HTA he has to see my selections and then be able accept his selections and when he submits it has to be appended into the same file.

I will need the log to have the user name auto filled into the file

End of the day i will know which are all that we have the dumps available for and which we do not.
A export button please to get the hta checks and software names to a file. With the users who said they have it.
0
 
LVL 11

Author Comment

by:bsharath
ID: 33614930
Hi Rob any views on this
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 33633216
Maybe like this?

Rob.
<html>
<head>
<hta:application
	ID="Software Checklist"
	ApplicationName="Software Checklist"
	SINGLEINSTANCE="YES"
	CONTEXTMENU="NO"
	MINIMIZEBUTTON="NO"
	MAXIMIZEBUTTON="NO"
	SCROLL="NO"
	BORDER="THIN"
	ICON=""
/>

<head>

<script language="vbscript">

window.resizeTo 800,600

Dim intAppCount
Dim strApplications

Sub Window_OnLoad
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Const intForReading = 1
    If Mid(document.location, 6, 3) = "///" Then
    	strHTAPath = Mid(Replace(Replace(document.location, "%20", " "), "/", "\"), 9)
    Else
    	strHTAPath = Mid(Replace(Replace(document.location, "%20", " "), "/", "\"), 6)
    End If
    strHTAPath = Left(strHTAPath, InStrRev(strHTAPath, "\"))
	strApplications = strHTAPath & "Applications.ini"
	
	Set objApps = objFSO.OpenTextFile(strApplications, intForReading, False)
	
	intCurrentOption = 0
	strOptions = "<table border=1 width='80%'><tr><th width=60%>Software Title</th><th>Available</th><th>On CD</th><th>Downloadable</th>"
	While Not objApps.AtEndOfStream
		strApp = Trim(objApps.ReadLine)
		If strApp <> "" Then
			strAvailable = ""
			strOnCD = ""
			strDownloadable = ""
			If InStr(strApp, ";") > 0 Then
				arrBits = Split(strApp, ";")
				strName = arrBits(0)
				If arrBits(1) = 1 Then strAvailable = "Checked"
				If arrBits(2) = 1 Then strOnCD = "Checked"
				If arrBits(3) = 1 Then strDownloadable = "Checked"
			Else
				strName = strApp
			End If
			intCurrentOption = intCurrentOption + 1
			strOptions = strOptions & "<tr><td>" & strName & "</td>" &_
				"<td><input type='checkbox' id='chkAvailable' " &_
				"name='chkAvailable' value='" & strName & "' " &_
				strAvailable & "></td>" &_
				"<td><input type='checkbox' id='chkOnCD' " &_
				"name='chkOnCD' value='" & strName & "' " &_
				strOnCD & "></td>" &_
				"<td><input type='checkbox' id='chkDownloadable' " &_
				"name='chkDownloadable' value='" & strName & "' " &_
				strDownloadable & "></td></tr>"
		End If
	Wend
	objApps.Close
	strOptions = strOptions & "</table>"
	DataArea.InnerHTML = strOptions
	intAppCount = intCurrentOption
End Sub

Sub SelectAll
	For Each objCheckBox In chkAvailable
		objCheckBox.Checked = True
	Next
	For Each objCheckBox In chkOnCD
		objCheckBox.Checked = True
	Next
	For Each objCheckBox In chkDownloadable
		objCheckBox.Checked = True
	Next
End Sub

Sub DeselectAll
	For Each objCheckBox In chkAvailable
		objCheckBox.Checked = False
	Next
	For Each objCheckBox In chkOnCD
		objCheckBox.Checked = False
	Next
	For Each objCheckBox In chkDownloadable
		objCheckBox.Checked = False
	Next
End Sub

Sub Save
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Set objOutput = objFSO.CreateTextFile(strApplications, True)
	Set objApps = CreateObject("Scripting.Dictionary")
	For Each objCheckBox In chkAvailable
		If objCheckBox.Checked = True Then
			objApps.Add objCheckBox.Value, ";1"
		Else
			objApps.Add objCheckBox.Value, ";0"
		End If
	Next
	For Each objCheckBox In chkOnCD
		If objCheckBox.Checked = True Then
			objApps(objCheckBox.Value) = objApps(objCheckBox.Value) & ";1"
		Else
			objApps(objCheckBox.Value) = objApps(objCheckBox.Value) & ";0"
		End If
	Next
	For Each objCheckBox In chkDownloadable
		If objCheckBox.Checked = True Then
			objApps(objCheckBox.Value) = objApps(objCheckBox.Value) & ";1"
		Else
			objApps(objCheckBox.Value) = objApps(objCheckBox.Value) & ";0"
		End If
	Next
	For Each strApp In objApps
		objOutput.WriteLine strApp & objApps(strApp)
	Next
	objOutput.Close
	MsgBox "Your selections have been saved."
End Sub

</script>

<style>
body
{
	font: 10pt Arial;
	background-color: buttonface;
	border: none;
}

td {
	font: 10pt Arial;
}

td.link {
	cursor: hand;
	color: blue;
	width: 200px;
}
table {
	margin-left: 50px;
}
</style>

</head>

<body>

<div id="DataArea"></div>

<table width="80%" border="0">
<tr>
<td width="33%">
<input type='button' value='Select All' name='btnSelectAll'  onClick='vbs:SelectAll'>
</td>
<td width="33%">
<input type='button' value='Deselect All' name='btnDeselectAll'  onClick='vbs:DeselectAll'>
</td>
<td>
<input type='button' value='Save' name='btnSave'  onClick='vbs:Save'>
</td>
</tr>
</table>

</body>

</html>

Open in new window

0
 
LVL 11

Author Comment

by:bsharath
ID: 33633356
Thanks a lot Rob perfect
Any help with this please...
http://www.experts-exchange.com/Programming/Languages/Q_26415576.html
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question