gratz Posted March 31, 2006 Share Posted March 31, 2006 (edited) Hi everyone this is probably a simple question and obviousbut here goescan i run a vb script from a runonceex.cmdI have tried this to perform a drive mappingbut it does not workI can use the script after in std os modei have placed the drive map script after everything except norton internet security 2005here is my runonceex.cmdcmdow @ /HID@Echo OffSET PP=%SystemDrive%\Install\SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Programs" /f 'Note The Words All Pcs Means this installation should be made on all pcs 'All Asus P5ad2 Motherboard Pcs 'Installs The Chipset drivers this needs a reboot hence the -b switch(must be installed before any other driversREG ADD %KEY%\001 /VE /D "Intel Chipset Software Installation" /fREG ADD %KEY%\001 /V 1 /D "%PP%Intelchipset\INFINST_AUTOL.EXE -A -b -s " /f 'this allows the previous program to finish any odd bits before loading the network drivers'REG ADD %KEY%\002 /VE /D "Running A Sleep Program for 30 seconds " /f'REG ADD %KEY%\002 /V 1 /D "%PP%sleep\sleep.EXE 30 " /fREG ADD %KEY%\010 /VE /D "Marvel Yukon network Card Driver Installation" /fREG ADD %KEY%\010 /V 1 /D "%PP%YukonNetworkDrivers\SetupYukonWin.exe /S /V\"/LIME %WINDIR%\YukonInstall.log REBOOT=ReallySuppress /qn"\"/f 'All Asus P5ad2 Motherboard Pcs 'All pcsREG ADD %KEY%\020 /VE /D "Microsoft.Net Framework V2" /fREG ADD %KEY%\020 /V 1 /D "%PP%MicrosoftNet2\dotnetfx.exe /q:a /c:\"install /q"\" /f'All Asus P5ad2 Motherboard PcsREG ADD %KEY%\035 /VE /D "Cmi 9880 high definition audio package" /fREG ADD %KEY%\035 /V 1 /D "%PP%CMIaudio\setup.exe /S" /fREG ADD %KEY%\040 /VE /D "Catalyst Control centre & all Drivers" /fREG ADD %KEY%\040 /V 1 /D "%PP%Ati\6-2_xp-2k_dd_ccc_wdm_enu_30152\setup.exe /s /w:wait " /fREG ADD %KEY%\050 /VE /D "Windows Media Player Installation" /fREG ADD %KEY%\050 /V 1 /D "%PP%WindowsMediaPlayer10\mpsetupedp.msi /qb" /fREG ADD %KEY%\060 /VE /D "Nero burning v6" /fREG ADD %KEY%\060 /V 1 /D "%PP%Applications\Nero\Nero-6.6.0.18_no_yt.exe /silent /noreboot /no_ui /sn=****-****-****-****-****-**** /write_sn" /f'All PcsREG ADD %KEY%\070 /VE /D "Microsoft office xp pro" /fREG ADD %KEY%\070 /V 1 /D "%PP%Applications\OfficeXP\SETUP.EXE " /fREG ADD %KEY%\080 /VE /D "Adobe Reader 7.07 Installation" /f REG ADD %KEY%\080 /V 1 /D "%PP%AdobeReader7\reader707.exe " /fREG ADD %KEY%\090 /VE /D "Active Sync 4.1" /f REG ADD %KEY%\090 /V 1 /D "%PP%ActiveSync41\setup.exe /S /v\"/qn INSTALLDIR=c:\MySyncDirectory"\" /fREG ADD %KEY%\100 /VE /D "Map Drive z shop folder" /f REG ADD %KEY%\100 /V 1 /D "%PP%MapZDrive.vbs " /fREG ADD %KEY%\105 /VE /D "Running A Sleep Program for 30 seconds " /fREG ADD %KEY%\105 /V 1 /D "%PP%sleep\sleep.EXE 60 " /f'try this for norton internet securityREG ADD %KEY%\110 /VE /D "Norton Internet Security 2005" /fREG ADD %KEY%\110 /V 1 /D "%PP%Norton\SYMSETUP.EXE /qn /norestart" /fEXITand here is my script .vbsDim WSHNetworkSet WSHNetwork = WScript.CreateObject("WScript.Network")WSHNetwork.MapNetworkDrive "z:", "\\SHOPTILL\Shop Folder"any ideas? thanks Edited March 31, 2006 by gratz Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 31, 2006 Share Posted March 31, 2006 Make the vbs script into a sfx file and it should run fine. Link to comment Share on other sites More sharing options...
gratz Posted March 31, 2006 Author Share Posted March 31, 2006 How?Do I need any other software? Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 31, 2006 Share Posted March 31, 2006 (edited) I use winrar to make a sfx file.I have modified your VBS script so it will delete it self after it has ran.Save As Gratz_MapDrive.vbs Dim Act, Fso, WSHNetwork, VbsFile Set WSHNetwork = WScript.CreateObject("WScript.Network") Set Fso = CreateObject("Scripting.FileSystemObject") Set Act = CreateObject("Wscript.Shell") VbsFile = Act.ExpandEnvironmentStrings("%SystemDrive%\Gratz_MapDrive.vbs") WSHNetwork.MapNetworkDrive "z:", "\\SHOPTILL\Shop Folder" If Fso.FileExists(VbsFile) Then Fso.DeleteFile(VbsFile) End IfThis is the SFX code ;The comment below contains SFX script commandsPath=.\%Systemdrive%\Setup=Wscript.exe %Systemdrive%\Gratz_MapDrive.vbsSilent=1Overwrite=1I have made this a SFX for you, I have not tested this, but in therory it should work.To modify the script use Winrar 1:\ extract the file to your desktop2:\ edit the VBS script3:\ rename the Gratz_MapDrive.vbs in the SFX to Gratz_MapDrive_Old.vbs4:\ add you edited Gratz_MapDrive.vbs5:\ after you have added the edited Gratz_MapDrive.vbs then delete Gratz_MapDrive_Old.vbs Edited April 3, 2006 by gunsmokingman Link to comment Share on other sites More sharing options...
RogueSpear Posted March 31, 2006 Share Posted March 31, 2006 (edited) I run tons of VBscript from RunOnceEx. Here is a little piece of my VBscript that I run from cmdlines.txt to set it up:If fs.FileExists(OEM & "\060_VPN.vbs") Then ws.RegWrite strKeyPath & "060\", "VPN software" , "REG_SZ" ws.RegWrite strKeyPath & "060\1", OEM & "\060_VPN.vbs", "REG_SZ"End IfIf fs.FileExists(OEM & "\070_VMwareTools.vbs") Then ws.RegWrite strKeyPath & "070\", "VMware Tools" , "REG_SZ" ws.RegWrite strKeyPath & "070\1", OEM & "\070_VMwareTools.vbs", "REG_SZ"End IfThere's no need to make an SFX or compile it or anything. The only real limitation is with cmdlines.txt. From there you must specify cscript.exe. Edited March 31, 2006 by RogueSpear Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 31, 2006 Share Posted March 31, 2006 (edited) I run my script from Cmdlines also but do not use Csript, I have them work from a hta. this gives me a interface to work with. I have a cmd file that start the hta that has my script in it. The SFX makes it act like a exe, then it clean up the vbs after it has ran. But RogueSpear is correct so that would also be another method.Hta from 13 minute to reboot Edited March 31, 2006 by gunsmokingman Link to comment Share on other sites More sharing options...
gratz Posted April 1, 2006 Author Share Posted April 1, 2006 I run tons of VBscript from RunOnceEx. Here is a little piece of my VBscript that I run from cmdlines.txt to set it up:Just a bit confused!do I remove my entry from runonceex.cmd and then put this entry in cmdlines.txtwith my script instead? Link to comment Share on other sites More sharing options...
gunsmokingman Posted April 1, 2006 Share Posted April 1, 2006 It depend on when you need it to run. For mapping drives I would assume you need it after the install is completed, so the RunOnceEx.cmd would be the best time. Use the SFX file that I posted as that will deletethe vbs file after it has ran. 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