Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: HTA Question

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,31659
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: HTA Question
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: HTA Question - 3/9/2006 9:57:37 AM   
  Navarre

 

Posts: 90
Score: 0
Joined: 10/19/2005
Status: offline
True thanks for that.

At this stage checking to see if a file exists is what I want to do, especially output the directory listing to an excel file for our records, and move another bunch of files from some of the same directories to a directory exists or given the option to create.

So at this stage this is essentially version 1, do the basic part and then try upgrade those bits to do anything extra.  My biggest probem is that I am very new to VBscript sort of learning (and at times badly) hopefully what I want to do to do a specific something.  As opposed to better way of doing things.

(in reply to rOOs)
 
 
Post #: 21
 
 RE: HTA Question - 3/9/2006 10:14:17 AM   
  rOOs


Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
check for existing of a file is easy (If fsobject.Fileexists = True Then)

output something to excel has 2 ways:
output to ;-delimited csv file or directly to excel with create an instance of excel and send the commands to insert...

filemoving is also simple in vbscript (copyfile or movefile method)

directory: if fso.folderexists = False Then fso.createfolder

Version 1 is always a good start... further developing is fun, and if its finished then you would like to start again and make everything written better :-))))

I think if you go on like that, you reach the goal of being able to script...

I'll try to show you always the best way to do something ( or at least the best way i know of :-) ) ...

So it's just after midnight here, i am going to sleep....

(in reply to Navarre)
 
 
Post #: 22
 
 RE: HTA Question - 3/9/2006 10:25:14 AM   
  Navarre

 

Posts: 90
Score: 0
Joined: 10/19/2005
Status: offline
My sort of big one at the momemt is to make a bit to move files to a new location but with a browse button / create a directory if it does not exist.

I want to usually go from one of my daily directories - K:\W1\Monday to N:\Accounts\RETAIL\2005-2006\ 2006-03 is the final directory and will change on a monthly basis.

(in reply to rOOs)
 
 
Post #: 23
 
 RE: HTA Question - 3/9/2006 6:07:14 PM   
  rOOs


Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
Browse for Folder goes like this:
HTML:
<input onDblClick=ChooseFolder() name='txtFolder' size=31 value=''>

VBSCRIPT:
Sub ChooseFolder
On Error Resume Next
Set objSA = CreateObject("Shell.Application")
Set oFolder = objSA.BrowseForFolder(0, "Choose your Folder:", 0, document.all.item("txtFolder").Value) 
   ' Choose the Folder, the document.all part reads the value in the field and will start form there when anything was given.

If oFolder.Items.Item <> "" Then
   Set oFolderItem = oFolder.Items.Item  
   document.all.item("txtFolder").innerText = oFolderItem.Path
End If
On Error GoTo 0
End Sub

and so you can doubleclick on the input and choose the folder you want...
then it places the path of the folder (even UNC) in the input box.. with another function you can take the txtFolder.Value and copy files...

what you could do, is put your default path in the value tag of the input in the html section....


(in reply to Navarre)
 
 
Post #: 24
 
 
Page:  <<   < prev  1 [2]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: HTA Question Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts