Aoshi Posted August 9, 2004 Share Posted August 9, 2004 Sorry i tried to search this in the forum and on google but I don't really know what to search for.How can i run JS/VBS Files? It says that .js or .vbs is no known extension for cscript/wscript and that there is now Script modul for this extension.I can't find a reason why it doesn't work.EDIT: Ok solved that, now it says that i should install from Control Panel. Link to comment Share on other sites More sharing options...
neo_3333 Posted August 9, 2004 Share Posted August 9, 2004 mazin,Is this code you talk about for %CDROM % ?Yes. mazin,Can I have a look at it ? Link to comment Share on other sites More sharing options...
mazin Posted August 10, 2004 Author Share Posted August 10, 2004 The Final Word: This winamp.js works anywhere, %CDROM% or %SYSTEMDRIVE%, under BATCH method or RunOnceEX!It does all the job: install Winamp, register Winamp, and copy winamp.ini!start /wait %systemdrive%\Install\Winamp\winamp.jsORstart /wait %CDROM%\Install\Winamp\winamp.jsREG ADD %KEY%\050 /VE /D "Winamp 5.04REG ADD %KEY%\050 /V 01 /D "%systemdrive%\Install\Winamp\winamp.jsORREG ADD %KEY%\050 /VE /D "Winamp 5.04REG ADD %KEY%\050 /V 01 /D "%CDROM%\Install\Winamp\winamp.jsvar WshShell = WScript.CreateObject ("WScript.Shell");var path = WScript.ScriptFullName;//getting the path to this scriptvar CDROM = path.substring(0,2);//extracting (DriveLetter:) from the pathWshShell.RUN (CDROM + "\\Install\\Winamp\\winamp.exe");//running exeWScript.Sleep(3000);//time needed by installer to extract its filesWshShell.AppActivate("Winamp Setup");//name of setup screenWScript.Sleep(500);//time to hold setup screenWshShell.SendKeys ("{ENTER}");//hitting Agree buttonWScript.Sleep(500);//usually, time to wait before executing next keystrokeWshShell.SendKeys ("{TAB}");//moving tabstop to the features paneWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Winamp AgentWScript.Sleep(500);WshShell.SendKeys (" ");//deselecting Winamp AgentWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//bypassing Winamp LibraryWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Modern Skin SupportWScript.Sleep(500);WshShell.SendKeys (" ");//deselecting Modern Skin SupportWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//bypassing User Interface ExtensionsWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//bypassing Audio File SupportWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Video File SupportWScript.Sleep(500);WshShell.SendKeys ("%{RIGHT}");//expanding Video File SupportWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//bypassing Nullsoft VideoWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting AVI/MPG/ASFWScript.Sleep(500);WshShell.SendKeys (" ");//deselecting AVI/MPG/ASFWScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Next buttonWScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Next buttonWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Desktop IconWScript.Sleep(500);WshShell.SendKeys (" ");//deselecting Desktop IconWScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Next buttonWScript.Sleep(500);WshShell.SendKeys ("{DOWN 2}");//setting Internet Connection to Not connected...WScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Next buttonWScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Install buttonWScript.Sleep(45000);//time to install WinampWshShell.SendKeys ("%{F4}");//closing WinampWshShell.RegWrite ("HKLM\\SOFTWARE\\Nullsoft\\Winamp\\regkey", "my-key-here");WshShell.RegWrite ("HKLM\\SOFTWARE\\Nullsoft\\Winamp\\regname", "mynamehere");var MySys = WshShell.Environment("process");//needed to expand ProgramFiles varvar FSO = WScript.CreateObject("Scripting.FileSystemObject");//needed for CopyFileFSO.CopyFile((CDROM + "\\Install\\Winamp\\winamp.ini") , (MySys("ProgramFiles") + "\\Winamp\\"));//copying winamp.iniNOTE:1- The word CDROM mentioned in winamp.js is merely a word. You can replace it with any other word you like. It represents the drive letter where winamp.js resides; e.g. C:, D:, or whatever. Therefore, this script is usable wherever we put it in, i.e. on a CD or HDD.2- This script does not install "Modern Skin Support". If you decide to install it, consider adding these strings immediately before the line commented "//closing winamp":WshShell.SendKeys ("%{F4}");//closing Winamp LibraryWScript.Sleep(500);Also, increase installation time from 45000 to 60000. Link to comment Share on other sites More sharing options...
neo_3333 Posted August 11, 2004 Share Posted August 11, 2004 Great Stuff, mazin Link to comment Share on other sites More sharing options...
mazin Posted August 11, 2004 Author Share Posted August 11, 2004 Great Stuff, mazin Thanks.I wasn't satisfied with the idea that JS is dependent on CMD for creating that path in the Registry, despite it worked well.Now, JS is completely independent, working on its own to define the path to Winamp.exe.It's now universal. BTW, if you use INF to install Winamp this way, let me know. Link to comment Share on other sites More sharing options...
neo_3333 Posted August 11, 2004 Share Posted August 11, 2004 Yeah, I use inf to setup winamp.[Version]Signature=$CHICAGO$[DefaultInstall]AddReg = RunOnceEx.XP.AddReg[unattended.XP]AddReg = RunOnceEx.XP.AddReg[RunOnceEx.XP.AddReg];http://support.microsoft.com/?kbid=232509HKLM,"%RunOnceEx%\",Title,0,"Installing Applications"HKLM,"%RunOnceEx%\",Flags,0x00010001,30HKLM,"%RunOnceEx%\001",,,"Winamp 5.04 Pro"HKLM,"%RunOnceEx%\001",1,,"""%1%\Install\Winamp\Winamp.js"""[strings]RunOnceEx = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx"%1% - Directory where inf file is in Link to comment Share on other sites More sharing options...
mazin Posted August 11, 2004 Author Share Posted August 11, 2004 Thanks.As I can understand, this is part of your INF. I mean it's not a separate INF. Right?And you tested it, didn't you? Link to comment Share on other sites More sharing options...
neo_3333 Posted August 11, 2004 Share Posted August 11, 2004 Yeah, it's part of my inf and it works. Link to comment Share on other sites More sharing options...
bonedaddy Posted August 28, 2004 Share Posted August 28, 2004 Mazin when you get a chance can you try ver 5.05, I can't get it to work...thanks bonedaddy Link to comment Share on other sites More sharing options...
mazin Posted August 28, 2004 Author Share Posted August 28, 2004 Mazin when you get a chance can you try ver 5.05, I can't get it to work...thanks bonedaddyI will. Thanks. Link to comment Share on other sites More sharing options...
bonedaddy Posted August 28, 2004 Share Posted August 28, 2004 Never mind, I was fooling around with path in the js and screwed it up....Sorry Mazin, 505 installs just fine.bonedaddy Link to comment Share on other sites More sharing options...
mazin Posted August 28, 2004 Author Share Posted August 28, 2004 Never mind, I was fooling around with path in the js and screwed it up....Sorry Mazin, 505 installs just fine.bonedaddyThanks for the news, anyway. I've just downloaded it. Let me enjoy it, too.EDIT: 5.05 is same screen clicks as 5.03a and 5.04.Thanks alot. Link to comment Share on other sites More sharing options...
nocheebo Posted September 2, 2004 Share Posted September 2, 2004 ok i've got a JScript going, and it looks alright, but it keeps giving me an error:Line: 81Char: 20Error: Expected ';'Code: 800A03ECSource: Microsoft JScript compilation errornow, i googled the error code, but all i got was something about incorrect parenthetical placements, which i don't have (or at least i think i don't). i've attached my script. also, when i delete that line, it tells me line 80 is messed up, then 79, and so on. any help would be appreciated. i'm familiar with c++, but this is my first foray into javascript. i figured if anyone could help me out it'd be you guys. EDIT: don't worry guys this isn't a virus winampscript.js Link to comment Share on other sites More sharing options...
mazin Posted September 2, 2004 Author Share Posted September 2, 2004 WshShell.SendKeys )("%{F4}");Delete the extra character in red.However, you're using the old JS. It's now developed. You can use the newest one in this post:http://www.msfn.org/board/index.php?showto...ndpost&p=163957 Link to comment Share on other sites More sharing options...
nocheebo Posted September 2, 2004 Share Posted September 2, 2004 wow... i'm ashamed of myself . anyway thanks a lot. i updated it to the new script. i read about half the pages then skipped to the last page . again thanks a lot mazin! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now