Login | |
|
 |
RE: Noob needs help!!! - 7/18/2005 10:37:28 PM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
quote:
set oShell= Wscript.CreateObject("WScript.Shell") If you set the following line at the top of your Script, that would be much neeter and won't use any extra memory
_____________________________
For more information, please see the "Read me First" topic. http://www.visualbasicscript.com
|
|
| |
|
|
|
 |
RE: Noob needs help!!! - 7/19/2005 9:23:34 AM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
you would start off of creating a HTA file, mostly b/c of the FSO part .... just copy / paste your code.... that's it :) <input type="button" ID="Exec1" value="Run me"> ... Sub Exec1_onClick() ' your code comes here End Sub
_____________________________
For more information, please see the "Read me First" topic. http://www.visualbasicscript.com
|
|
| |
|
|
|
 |
RE: Noob needs help!!! - 7/19/2005 9:19:51 PM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
no problem, you mentioned that you do not know alot about VBS....here is the HTA that you will need. Save this for future development: <HTML> <HEAD> <HTA:APPLICATION ID="oWinAmpPL" APPLICATIONNAME="Winamp_Playlist" BORDER="dialog" BORDERSTYLE = "normal" CAPTION="yes" CONTEXTMENU = "no" ICON="library.ico" INNERBORDER = "yes" MAXIMIZEBUTTON = "no" MINIMIZEBUTTON = "yes" SCROLL = "auto" SCROLLFLAT = "yes" SELECTION = "no" SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" SYSMENU="yes" VERSION="1.0" WINDOWSTATE="normal" /> <TITLE>Winamp Playlist</TITLE> <SCRIPT LANGUAGE="VBScript"> <!-- Sub FnListfiles_onClick() Dim oShell, oFSO, f, FileSource, FileDest, fList, Message set oShell= CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") Set f = oFSO.GetFolder("C:\Winamp\Playlists") fList = "" For Each file In f.Files fList=fList & File.Name & chr(10) Next datarea.innerhtml = fList Message = InputBox(fList,"Load Play list (Type exactly as listed)") FileSource="C:\winamp\Playlists\" & Message & ".m3u" FileDest="c:\winamp\winamp.m3u" if Message = "" then WScript.echo "Playlist has not been changed" WScript.Quit(0) else oShell.Run "runas /user:jukebox ""c:\winamp\StopWinamp.bat""" WScript.Sleep 100 oShell.Sendkeys "****~" WScript.Sleep 500 oFso.CopyFile FileSource,FileDest WScript.Sleep 300 oShell.Run "runas /user:jukebox ""c:\winamp\StartWinamp.bat""" WScript.Sleep 100 oShell.Sendkeys "****~" WScript.Sleep 3000 WScript.echo "Play list has been changed to: " & Message '*** clean up Set oShell = Nothing Set oFSO=Nothing Set f = Nothing End If End Sub --> </SCRIPT> </HEAD> <BODY background="ns-logo.gif"><BASEFONT FACE="Times New Roman","Arial"> <p><br><br><p> <input type="button" ID="FnListfiles" value="Winamp Playlist editor"> <div ID="DataArea"> </div> </BODY> </HTML>
_____________________________
For more information, please see the "Read me First" topic. http://www.visualbasicscript.com
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|