Sgt. D. Pilla Posted September 7, 2008 Posted September 7, 2008 Hey,I currently have setupcomplete.cmd executing the following code...@echo offTITLE Finalizing Setup Stagecmdow.exe @ /DIS /TOPECHO !! !!ECHO !! !!ECHO !! DO NOT CLOSE THIS WINDOW !!ECHO !! !!ECHO !! !!ECHO.ECHO Installing Boot Manager Grub, Please wait...ECHO.for %%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\bootmgr (if not exist %%A\setup.exe (echo.echo Installing to drive %%Aecho.if exist %%A\menu.lst attrib %%A\menu.lst -h -r -sif exist %%A\menu.lst ren %%A\menu.lst menu_lst.bakif exist %%A\grldr attrib %%A\grldr -h -r -scopy %systemroot%\setup\scripts\grldr %%A\grldrattrib %%A\grldr +h +s +r%systemroot%\setup\scripts\bootinst /nt60 %%A)))EHCO.ECHO.ECHO Installing Windows Post Installer, please wait...ECHO.ECHO STEP 1: PREPARING TO COPY FILESECHO.ECHO Preparing to copy files...ECHO Please wait...:makedirECHO.ECHO STEP 2: CREATING DIRECTORY STRUCTUREECHO.ECHO Directory Structure Being Created...md %SYSTEMDRIVE%\WPI_ApplicationsIF ERRORLEVEL 1 GOTO retryECHO Done!ECHO.ECHO STEP 3: COPYING DIRECTORYS AND FILESECHO.xcopy "%CD%\WPI" "%SYSTEMDRIVE%\WPI_Applications" /e /f /y /c /vIF ERRORLEVEL 1 GOTO errorECHO.ECHO Verifying...ECHO.cd %SYSTEMDRIVE%\WPI_Applicationsdir /s /bECHO.ECHO File Transfer Complete...ECHO.ECHO Performing cleanup steps...ECHO Removing temp files...cd %windir%\Setup\SCRIPTSdel WPI /F /Qrd WPIECHO Now executing Windows Post Installer, then Exiting script...Start %systemdrive%\WPI_Applications\WPI.htaECHO Goodbye!pauseexit /B:errorECHO.ECHO File Transfer Failed!ECHO You will not be able to run WPI Applications from your HDD laterECHO You will instead require this install DVDECHO Now exiting...ECHO Goodbye!pauseexit /B:retryECHO.ECHO ERROR STEP 1: REMOVING PRIOR DIRECTORY STRUCTUREECHO.ECHO Removing directory and contents...rd %SYSTEMDRIVE%\WPI_Applications /s /qIF NOT ERRORLEVEL 1 GOTO exitECHO Done!ECHO Retrying Directory Structure Creation...GOTO makedir:exitECHO An error occured that this script could not correctECHO You will not be able to run WPI Applications from your HDD laterECHO You will instead require this install DVDECHO Or instead you can try a manual copyECHO Now exiting...ECHO Goodbye!pauseexit /BProblem with that is their is no visual with this happening, so it gives the impression the installation has hung, and users, including myself until i researched setupcomplete.cmd, forcefully restarted the computer.The reason it gives the impression installation has hung is because it copies 3GB worth of applications which naturally takes a long time.I'm after a script that will allow the above code to run after the user has logged on.I read about firstlogon but I don't have that file.The windows files I am using is an image of my recovery partition, so the only files I have are as follows...dell.xmlfirst.cmdoobe.cmdsystem.cmdsetupcomplete.cmdDell.xm appears to be firstlogon, but im not to sure, this is its contents...<?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="oobeSystem"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OEMInformation> <Manufacturer></Manufacturer> <Logo>c:\windows\system32\oobe\dell_badge.bmp</Logo> </OEMInformation> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <CommandLine>c:\windows\setup\scripts\first.cmd</CommandLine> <Description>first boot command file</Description> <Order>1</Order> </SynchronousCommand> </FirstLogonCommands> </component> </settings> <cpi:offlineImage cpi:source="wim:c:/work/sources/install.wim#Windows Vista ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /></unattend>Would I be correct in saying, If i want a script to execute at the first logon of a user, that I would moddify the first.cmd file to suit my needs?Further, would that mean that first.cmd runs once with EACH user, or just a single user.Because of what the script does, It can only run once on the system.It copies a directory and its contents, removes the original directory, executes wpi.hta which then installs applicationsIf that was to happen with every user it would error out an aweful lot and just look silly.Basically, I need my script to run once only but after setup (Say when the desktop has loaded), or any other time where there can be a visual of the process taking place
browney595 Posted September 7, 2008 Posted September 7, 2008 what does the content of the first.cmd batch script contain?
Sgt. D. Pilla Posted September 7, 2008 Author Posted September 7, 2008 BEFORE I added things to it to test, nothing.About an hour ago I added my script to it to test, so at the moment, it contains the following...@echo offTITLE Finalizing Setup Stagecmdow.exe @ /DIS /TOPECHO !! !!ECHO !! !!ECHO !! DO NOT CLOSE THIS WINDOW !!ECHO !! !!ECHO !! !!EHCO.ECHO.ECHO Installing Windows Post Installer, please wait...ECHO.ECHO STEP 1: PREPARING TO COPY FILESECHO.ECHO Preparing to copy files...ECHO Please wait...:makedirECHO.ECHO STEP 2: CREATING DIRECTORY STRUCTUREECHO.ECHO Directory Structure Being Created...md %SYSTEMDRIVE%\WPI_ApplicationsIF ERRORLEVEL 1 GOTO retryECHO Done!ECHO.ECHO STEP 3: COPYING DIRECTORYS AND FILESECHO.xcopy "%CD%\WPI" "%SYSTEMDRIVE%\WPI_Applications" /e /f /y /c /vIF ERRORLEVEL 1 GOTO errorECHO.ECHO Verifying...ECHO.cd %SYSTEMDRIVE%\WPI_Applicationsdir /s /bECHO.ECHO File Transfer Complete...ECHO.ECHO Performing cleanup steps...ECHO Removing temp files...cd %windir%\Setup\SCRIPTSdel WPI /F /Qrd WPIECHO Now executing Windows Post Installer, then Exiting script...Start %systemdrive%\WPI_Applications\WPI.htaECHO Goodbye!pauseexit /B:errorECHO.ECHO File Transfer Failed!ECHO You will not be able to run WPI Applications from your HDD laterECHO You will instead require this install DVDECHO Now exiting...ECHO Goodbye!pauseexit /B:retryECHO.ECHO ERROR STEP 1: REMOVING PRIOR DIRECTORY STRUCTUREECHO.ECHO Removing directory and contents...rd %SYSTEMDRIVE%\WPI_Applications /s /qIF NOT ERRORLEVEL 1 GOTO exitECHO Done!ECHO Retrying Directory Structure Creation...GOTO makedir:exitECHO An error occured that this script could not correctECHO You will not be able to run WPI Applications from your HDD laterECHO You will instead require this install DVDECHO Or instead you can try a manual copyECHO Now exiting...ECHO Goodbye!pauseexit /BGoogle isn't really helping me learn what first.cmd does, or the other cmd files in the scripts directory
MAVERICKS CHOICE Posted September 7, 2008 Posted September 7, 2008 You really seem to be complicating the process youre trying to perform? You can run WPI without all the fuss post Vista UA.Have you thoroughly read the WPI thread on this board?
Sgt. D. Pilla Posted September 7, 2008 Author Posted September 7, 2008 Sure have, believe it or not I'm making the entire process easier.WPI won't launch from the disk, and the people in the WPI forums are stumpped as to why.So its turned out easier to copy the contents to disk first, then launching the installer that way.So back to my question, which script is post UA?I'm assuming first.cmd?
MAVERICKS CHOICE Posted September 7, 2008 Posted September 7, 2008 Normally in firstlogon.cmd but could be referred to as first.cmdThis is how I start WPI from UA<SynchronousCommand wcm:action="add"> <CommandLine>%AppsRoot%WPI\WPI.hta</CommandLine> <Description>WPI Application Installer</Description> <Order>120</Order> </SynchronousCommand>As for shortcuts & cleaning up I do this in WPI.
Sgt. D. Pilla Posted September 8, 2008 Author Posted September 8, 2008 Ok, I'll give that a go, setting the sync command to run the batch script.I'll post back what happens
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now