VBS
VBS
VBS
/////////////////////////
just copy:
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////
choose file:
Set wShell=CreateObject("WScript.Shell")
Set oExec=wShell.Exec("mshta.exe ""about:<input type=file
id=FILE><script>FILE.click();new
ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.val
ue);close();resizeTo(0,0);</script>""")
sFileSelected = oExec.StdOut.ReadLine
wscript.echo sFileSelected
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////
<html>
<head>
<HTA: Application
Border = Thick
BorderStyle = Complex
ShowInTaskBar = No
MaximizeButton = No
MinimizeButton = No
>
</object>
<script language = "VBScript">
Sub ChooseSaveFolder
strStartDir = "c:\"
userselections.txtFile.value = PickFolder(strStartDir)
End Sub
Function PickFolder(strStartDir)
Dim SA, F
Set SA = CreateObject("Shell.Application")
Set F = SA.BrowseForFolder(0, "Choose a folder", 0, strStartDir)
If (Not F Is Nothing) Then
PickFolder = F.Items.Item.path
End If
Set F = Nothing
Set SA = Nothing
End Function
</script>
</head>
<body>
<form name="userselections">
<input type = "text" name = "txtFile" size="50" />
listAllFiles&SubFolders:
startFolder = "D:\testfolder1"
If objFSO.FolderExists(startFolder) Then
objFSO.CreateFolder(destFolderPath)
End If
'empty echo
Wscript.Echo
Sub ShowSubFolders(Folder)
Next
Wscript.Echo
Next
End Sub
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////
listAllFiles:
objStartFolder = "D:\testfolder1"
Wscript.Echo objFile.Name
Next
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////
copy hta:
<html>
<head>
<title>My Logfile App</title>
<HTA:APPLICATION
APPLICATIONNAME="My Logfile App"
ID="MyLogfileApp"
VERSION="1.0"/>
</head>
<script language="VBScript">
Sub Window_OnLoad
window.resizeto 500,500
End Sub
Dim destination,source
Sub Start_Button()
source = document.getElementById("source").value
destination = document.getElementById("destfile").value
'-------------------------------------------------------------
' Choose folder script--------------------------------------
'Sub ChooseSaveFolder
' strStartDir = "c:\"
' userselections.txtFile.value = PickFolderSource(strStartDir)
'End Sub
'Function PickFolderSource(strStartDir)
'Dim SA, F
'Set SA = CreateObject("Shell.Application")
'Set F = SA.BrowseForFolder(0, "Choose a folder", 0, strStartDir)
'If (Not F Is Nothing) Then
' PickFolderSource = F.Items.Item.path
'End If
'Set F = Nothing
'Set SA = Nothing
'End Function
'---------------------------------------------------
' chose file-----------------
Set wShell=CreateObject("WScript.Shell")
Set oExec=wShell.Exec("mshta.exe ""about:<input type=file
id=FILE><script>FILE.click();new
ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.val
ue);close();resizeTo(0,0);</script>""")
sFileSelected = oExec.StdOut.ReadLine
wscript.echo sFileSelected
soruce = sFileSelected
'----------------------------
Window.Alert "Done!"
End Sub
</script>
<!-- BODY------------------------------------------------------>
<body bgcolor="white">
<center>
<p></>
<p></>
<p></>
<label>Choose your sorce file.</label><br />
<p></>
<!-- <input type = "button" value = "Browse ..." onClick="ChooseSaveFolder" />
-->
<p></>
<p></>
<p></>
<!-------------------------------------------------------------->
</html>
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////