Does anyone have any suggestions how I can modify my .hta so that the
message box also returns the info that would be shortcut file's name (except
for the .url at the end)?
Thanks for reading this and for your time and help.
MarceepooNu
--
MarceepooNu
<html>
<head>
<title>Drag and Drop, dataTransfer.getData("URL")</title>
<style>
#divTarget {
position: absolute;
left: 50px;
width: 200px;
height: 200px;
background-color: yellow}
</style>
<HTA:APPLICATION
APPLICATIONNAME="Drag and Drop, dataTransfer.getData("URL")"
ID="DragandDropDataTransferGetdata"
VERSION="1.0"/>
</head>
<script language="VBScript">
FullName = replace(DragandDropDataTransferGetdata.commandLine,chr(34),"")
arrFN=split(FullName,"\")
FileName = Trim(arrFN(ubound(arrFN)))
SourceDir=replace(FullName,FileName,"")
Sub Window_OnLoad
'This method will be called when the application loads
'Add your code here
End Sub
Sub subRarCpyThisPrgFile2Pdrv
Dim sHtaPrgFullName
Dim sThisHtaFullNam
Dim sThisHtaFileName
Dim sCmdLine
Dim sRarCopyScriptFullName
Dim sArgFullNameOfFil2bBakdUp
Dim oFSO
Const LOCAL_BACKUPDIR = "L"
Const SVR6_BACKUPDIR = "SVR6"
Const SCRIPT_TYPE = "VBS"
Set oFSO = CreateObject("Scripting.FileSystemObject")
'http://gallery.technet.microsoft.com/ScriptCenter/de-de/7a7f9937-0c6f-4f1e-a953-d29e47b2f5d5 ''''''''
sThisHtaFullName = Trim(FullName)' "\\svr6\Data1\data\_Shtcuts\Toolbar
links\A\A_HtaReplacment\ToolbarA_replacement.aaa.hta"
sThisHtaFileName = Trim(oFSO.GetFileName(sThisPrgFullName))
sThisPrgFullName = sThisHtaFullName
If Len(sThisHtaFullName) > 5 Then
sThisPrgFullName = sThisHtaFullName
Else
sThisPrgFullName = WScript.ScriptFullName
End If
sRarCopyScriptFullName =
"K:\data\Programs\HtaPrgs\Vbs.RarCpyBakupSelected.file.namedArgs.aaa.vbs"
sArgFullNameOfFil2bBakdUp = "/FulNameOfFil2bBakdUp:" & Chr(34) &
sThisPrgFullName & Chr(34)
' sArgFullNameOfArcFile = "/RarArcFilPath:" & Chr(34) &
"P:\Data\VB\HTML_MarcsPrgs\ItWorks\" '& sThisHtaFileName & Chr(34)
sArgPathOfArcFile = "/RarArcFilPath:" & chr(34) &
"\\svr6\D\Data\VB\HTML_MarcsPrgs\ItWorks_Hta\" & chr(34)'& _
' sThisHtaFileName & ".rar" & Chr(34)
' sCmdLine = "wscript " & Chr(34) & sRarCopyScriptFullName & Chr(34) & " " &
sArgFullNameOfFil2bBakdUp & Chr(34) & _
' sThisHtaFullName & Chr(34) & " " & sArgFullNameOfArcFile
sCmdLine = "wscript " & Chr(34) & sRarCopyScriptFullName & Chr(34) & " " &
sArgFullNameOfFil2bBakdUp & _
" " & sArgPathOfArcFile
' MsgBox sCmdline
Set objShell = CreateObject("Wscript.Shell")
objShell.Run sCmdline '"notepad.exe c:\scripts\test.txt"
End Sub
Function fnDrop
Dim strRetVal
strRetVal = window.event.dataTransfer.getData("URL")
MsgBox strRetVal
subRarCpyThisPrgFile2Pdrv
End Function
Function cancelEvent
window.event.returnValue = False
End Function
</script>
<body bgcolor="white">
<h1>Drag and Drop, dataTransfer.getData("URL").</h1>
<p>This page was copied from webreference.com. Try dragging
<a
href="http://webreference.com/programming/javascript/dragdropie/Example2.htm">this link</a>,
and dropping it on the yellow box below.</p>
<div id="divTarget"
ondragenter="cancelEvent()"
ondragover="cancelEvent()"
ondrop="fnDrop()">Drop on me</div>
<!--Add your controls here-->
<!--{{InsertControlsHere}}-Do not remove this line-->
</body>
</html>
--
MarceepooNu