4 kwi 2008

Zapis danych do pliku

Dim fso, file_r
Set fso  = CreateObject("Scripting.FileSystemObject")

Set file_r = fso.CreateTextFile("raport.txt", True, False)
file_r.WriteLine("Tekst do zapis")
file_r.Close

WScript.echo "Koniec"
4 kwi 2008

Zamiana wybranych kodów znaków z UTF8 na WIN

cell_key = trs.item(d).childNodes(0).innerText

cell_key = Replace(cell_key, "ć", "ć")
cell_key = Replace(cell_key, "Ĺ›", "ś")
cell_key = Replace(cell_key, "Ăł", "ó")
cell_key = Replace(cell_key, "Ĺ„", "ń")
4 kwi 2008

Wyświetlenia okna wyboru folderu

Dim WshShell
Dim objShell
Dim ssfDir
Dim objFolder
Dim sdDir
WScript.Echo("Wybierz katalog do wysylki")

ssfDir = 0
set objShell = CreateObject("Shell.Application")
 set objFolder = objShell.BrowseForFolder(0, "Wybierz katalog", 0, ssfDir)
  if (not objFolder is nothing) then
'   sDir = objFolder.Items().Item.Path
   Set sDir = objFolder.Items()
   sCont = sDir.Count
   Set sdDir = sDir.Item
   sdpDir = sdDir.Path
   WScript.Echo (sdpDir & sCont)
  end if
set objFolder = nothing
3 kwi 2008

Wydobycie z url strony wartości zmiennej p

var idx = 0;
var url = document.location.href.substring(0, document.location.href.length);
var nr = url.indexOf('p=');
if (nr != -1) {
  idx = url.substr(nr + 2, 10);
}

Wydobycie z url strony wartości zmiennej p