MHz Posted January 1, 2005 Share Posted January 1, 2005 IF EXIST D:\AUTORUN.INF set CDROM=D:IF EXIST E:\AUTORUN.INF set CDROM=E:IF EXIST F:\AUTORUN.INF set CDROM=F:IF EXIST G:\AUTORUN.INF set CDROM=G:IF EXIST H:\AUTORUN.INF set CDROM=H:IF EXIST I:\AUTORUN.INF set CDROM=I:IF EXIST J:\AUTORUN.INF set CDROM=J:IF EXIST K:\AUTORUN.INF set CDROM=K:IF EXIST L:\AUTORUN.INF set CDROM=L:IF EXIST M:\AUTORUN.INF set CDROM=M:IF EXIST N:\AUTORUN.INF set CDROM=N:%CDROM%pause1) If you run this batch with your original commands with a cdrom in a drive, it works.2) You do not use the cdrom variable within your script.So no problem showing with the script shown, that I can see. Why set the cdrom variable? Not needed. Link to comment Share on other sites More sharing options...
jamesas Posted January 1, 2005 Author Share Posted January 1, 2005 well by what i think i did a test run the cdrom varible carried over to wpi and i need the cdrom varible so i dont have to make setup copy over 1.6 gigs to the hdd Link to comment Share on other sites More sharing options...
MHz Posted January 1, 2005 Share Posted January 1, 2005 The CDROM variable is is limited to within the script. It will not be available for use by WPI as set by this script. WPI needs a routine within itself for setting a CDROM variable. Link to comment Share on other sites More sharing options...
jamesas Posted January 1, 2005 Author Share Posted January 1, 2005 well then how do i set the varible to be also in WPI Link to comment Share on other sites More sharing options...
MHz Posted January 1, 2005 Share Posted January 1, 2005 Here is a link in the WPI forum for find CDROM Link to comment Share on other sites More sharing options...
jamesas Posted January 1, 2005 Author Share Posted January 1, 2005 well thankyou very much this will be helpful but one thing i have left to ask is if i open a cmd batch file from wpi will the cdrom varible still work or will i ahve to modify all these cmds somehowBTW in WPI if i have a 2nd cmd setup does that wait for the first one to finish Link to comment Share on other sites More sharing options...
MHz Posted January 1, 2005 Share Posted January 1, 2005 If you create a cmd batch file from WPI that will access the CDROM, you will need to set a CDROM variable within that script.Consider the CDROM variable as only a local variable.Use Start /Wait for programs in command files to stop following being executed. Link to comment Share on other sites More sharing options...
jamesas Posted January 1, 2005 Author Share Posted January 1, 2005 Well i have numerous scripts like this to run the setups and kill processes or add regkeys after the setup@echo offtitle Installing MSN Messenger Plusstart /wait %cdrom%\install\Applications\msnplus\6\MsgPlus-325.exe /SilentInstallNoSponsor%cdrom%\install\Applications\msnplus\pskill.exe msnmsgr.exe%cdrom%\install\Applications\msnplus\pskill.exe msgplus.exeexithow would i make this into a full WPI script thing Link to comment Share on other sites More sharing options...
MHz Posted January 1, 2005 Share Posted January 1, 2005 I am not really familar with WPI commands. It would be best to use the WPI commands. Otherwise, each of those scripts would need a cdrom set routine.e.g.@echo offtitle Installing MSN Messenger PlusIF EXIST D:\AUTORUN.INF set CDROM=D:IF EXIST E:\AUTORUN.INF set CDROM=E:IF EXIST F:\AUTORUN.INF set CDROM=F:IF EXIST G:\AUTORUN.INF set CDROM=G:IF EXIST H:\AUTORUN.INF set CDROM=H:IF EXIST I:\AUTORUN.INF set CDROM=I:IF EXIST J:\AUTORUN.INF set CDROM=J:IF EXIST K:\AUTORUN.INF set CDROM=K:IF EXIST L:\AUTORUN.INF set CDROM=L:IF EXIST M:\AUTORUN.INF set CDROM=M:IF EXIST N:\AUTORUN.INF set CDROM=N:start /wait %cdrom%\install\Applications\msnplus\6\MsgPlus-325.exe /SilentInstallNoSponsor%cdrom%\install\Applications\msnplus\pskill.exe msnmsgr.exe%cdrom%\install\Applications\msnplus\pskill.exe msgplus.exeexit A lot of copy and pasting into all script needed. Link to comment Share on other sites More sharing options...
MHz Posted January 1, 2005 Share Posted January 1, 2005 @echo offtitle Installing MSN Messenger Plusfor %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%a:\Autorun.inf set CDROM=%%a:start /wait %cdrom%\install\Applications\msnplus\6\MsgPlus-325.exe /SilentInstallNoSponsor%cdrom%\install\Applications\msnplus\pskill.exe msnmsgr.exe%cdrom%\install\Applications\msnplus\pskill.exe msgplus.exeexitThis style looks better thoughEdit: If your software is on the cd in install\Applications... , why not have these batch files in install\Applications, and use relative addressing?WPI will have the cdrom variable so you just call the batches on the cd. Link to comment Share on other sites More sharing options...
jamesas Posted January 1, 2005 Author Share Posted January 1, 2005 if anyone knows WPI could they help me here@MHz ; yeh that looks better but still brings up errors, thanks for all the help tho Link to comment Share on other sites More sharing options...
un4given1 Posted January 1, 2005 Share Posted January 1, 2005 Hey un4given1 I don't mean to gloat, but yes, I do see that both of us try to help people, and ask them to search when its relevant!(pun intended... I'm referring to what you'd said about too many people responding with "search" instead of the answer)I did that on purpose Link to comment Share on other sites More sharing options...
jamesas Posted January 2, 2005 Author Share Posted January 2, 2005 will the commands that i use in cmd prompt work in WPI likeCOPYREGEDIT /S start /wait Link to comment Share on other sites More sharing options...
gunsmokingman Posted January 2, 2005 Share Posted January 2, 2005 (edited) Here A script That Will Run From Any Where And Pass The VariblesThe Only Down side it seems is it cant handle spaces in the namesI tried quotes but was not able to get it to work with spaces.So make Sure There no Space In The script.Purple That A Test Of A Install I Did With This EDIT TO YOUR NEEDSRed Means You Can deleteOrange Is The Test Of The CmdBlue Is the Clean Up Partecho offclsmode con: cols=55 lines=4color 5fTITLE PSP 9 PRO INSTALLSET L1=%~dp0TESTLOC1\MKDIR "%L1%"ECHO TEST LOCATION 001 > %L1%TSTLOC1.TXTECHO MESSAGE TEST 1 >> %L1%TSTLOC1.TXTping -n 1 127.0.0.1>nulgoto WORK:WORKif EXIST "%~dp0\TESTLOC1\TSTLOC1.TXT" (SET CD=%~dp0TESTLOC1\)::::::::::::::::::::::::::::EDIT THIS BELOW AND IT WILL RUN THE INSTALL::" )echo off::" )cls::" )mode con: cols=55 lines=4::" )color 5f::" )TITLE MicroAngelo57 INSTALL::" )SET CD=%~dp0MicroAngelo\::" )if EXIST "%~dp0\Install\MicroAngelo\MicroAngelo57.exe" (SET CD=%~dp0Install)::" ):: start %CD%\MicroAngelo\MicroAngelo57.exe /S /QN)::" )::ping -n 1 127.0.0.1>nul::SET CD1=%CD%\MicroAngelo\::ECHO YOUR LOCATION IS:::SET /P = %CD1%::::::::::::::::::::::::::::EDIT THIS ABOVE AND IT WILL RUN THE INSTALLECHO YOUR LOCATION IS:SET /P = %cd% > CU1.vbs echo Dim Garbage>> CU1.vbs echo set Garbage = (CreateObject("Scripting.FileSystemObject"))>> CU1.vbs echo msgbox "Starting Clean UP?",vbokonly+48,"Clean Up">> CU1.vbs echo Garbage.Deletefile ("%cd%TSTLOC1.TXT")>> CU1.vbs echo Garbage.DeleteFile ("\CU1.vbs")>> CU1.vbs echo wscript.sleep 500>> CU1.vbs echo Delete=("%cd%TSTLOC1.TXT")>> CU1.vbs echo Delete=("\CU1.vbs")>> CU1.vbs echo wscript.sleep 500>> CU1.vbs echo msgbox "Clean UP Completed?",vbokonly+48,"Clean Up Those Files"start /w CU1.vbsrmdir %cd%set /p = Press Key To CloseI made This A self Extracting Rar To Be able To Run From The LinkThe Cmd Will Be Located In %systemdrive% Edited January 5, 2006 by gunsmokingman Link to comment Share on other sites More sharing options...
jamesas Posted January 2, 2005 Author Share Posted January 2, 2005 how does this script find what the cd drive is becuse im very dumb when it comes to codes 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