General discussion

Locked

VBScript/HTA problem

By JRod86 ·
Due to space limitations I can't include the full HTA, but it only copies the user folder to c:\doc and settings, no notes or fav's or desktop. Everything appears to work fine, I call the setup() sub on a click event. All checkboxes are checked. It gives me the message copy complete (no errors)

<SCRIPT Language="VBScript">
Sub Window_Onload()
self.ResizeTo 425,250
userName.focus()
Favorites.Checked=1
Desktop.Checked=1
Notes.Checked=1
End sub

Sub Setup()
If userName.Value = "" Then
msgBox "Please enter a valid User Name", VBOKonly, "USER Error"
ElseIf fromname.Value = "" Then
msgBox "Please enter a valid Computer Name", VBOKonly, "USER Error"
ElseIf toname.Value = "" Then
msgBox "Please enter a valid Computer Name", VBOKonly, "USER Error"

End If

copFolder = "\\" & fromname.Value & "\c$\documents and settings\" & userName.Value & "\Favorites"
copFolder2 = "\\" & fromname.Value & "\c$\documents and settings\" & userName.Value & "\Desktop"
copNotesini = "\\" & fromname.Value & "\c$\program files\Lotus\Notes\notes.ini"
copNotesData = "\\" & fromname.Value & "\c$\program files\Lotus\Notes\data"
toFolder = "\\" & toname.Value & "\c$\documents and settings\" & userName.Value & "\"
toFolder2 = "\\" & toname.Value & "\c$\program files\lotus\notes\"

set objFSO = CreateObject("Scripting.FileSystemObject")

If Not objFSO.FolderExists(toFolder) Then
objFSO.CreateFolder(toFolder)
End If

If Favorites.Checked=1 Then
objFSO.CopyFolder copFolder, toFolder, true
End If

If Desktop.Checked=1 Then
objFSO.CopyFolder copFolder2, toFolder, true
End If

If Notes.Checked=1 Then
objFSO.CopyFile copNotesini, toFolder2, true
objFSO.CopyFolder copNotesData, toFolder2, true
End If

msgBox "Copy Complete"
End sub
</SCRIPT>

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by JRod86 In reply to VBScript/HTA problem

insert the script section where I have indicated. It's too long to post as a whole.

<html>

<!--
Hotel Station Setup
Written by: Jarrod Coulter

This HTML Application copies any combination of Favorites, Desktop Icons, or Lotus Notes information
from one computer on the Thrivent network to another computer.

**** YOU MUST HAVE ADMINISTRATIVE RIGHTS TO BOTH COMPUTERS TO RUN THIS PROGRAM ****
-->
<head>

<title>Hotel Station Setup</title>

<HTA: Application
ID="HotelSetup"
APPLICATIONNAME="HotelSetup_HTA"
SCROLL="no"
SINGLEINSTANCE="no"
SYSMENU="no"
WINDOWSTATE="normal">
</head>

<style type="text/css">
BODY{background-color: buttonface; font-family: Helvetica; font-size: 10; text-align: center;}
.button{font-family: arial; font-size: 10;}
TD{font-family: Helvetica; font-size: 10; text-align: center;}
</style>

****Script goes in here****

<body>
Enter the username to copy:         <input type=text ID=userName name=userName size=15><BR>
Enter the computer to copy from: <input type=text ID=fromname name=fromname size=15><BR>
Enter the computer to copy to:     <input type=text name=toname size=15><BR>
<HR><BR>
<font size=2>Items to copy</font><BR>
<input type=checkbox name=Favorites> Favorites   <input type=checkbox name=Desktop> Desktop Icons   
<input type=checkbox name=Notes> Lotus Notes<BR><HR>
<input type="button" value="Copy" OnClick="Setup()">
</body>

</HTML>

Collapse -

by tross2005 In reply to VBScript/HTA problem

in this section of code
I manipulated the 1's to "True"
If Favorites.Checked="True" Then
objFSO.CopyFolder copFolder, toFolder, true
End If

If Desktop.Checked="True" Then
objFSO.CopyFolder copFolder2, toFolder, true
End If

If Notes.Checked="True" 1 Then
objFSO.CopyFile copNotesini, toFolder2, true
objFSO.CopyFolder copNotesData, toFolder2, true
End If

This it worked.

Collapse -

by JRod86 In reply to

First, let me say thank you so much for helping me. That worked perfectly. I knew it was something rediculously simple, but just couldn't figure it out. Thanks again.

Collapse -

by JRod86 In reply to VBScript/HTA problem

This question was closed by the author

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums