Jump to content

Batch file can't find installers


Recommended Posts

So, I have a Unattended Windows XP Install, which works fine, with a batch file that runs in SVCPACK.inf. I tested the batch file with the apps outside the installer whcih works fine. Then I tested on the install image and got an "Windows cannot find the file" error, which is odd since the files are present in the SVCPACK folder. After the install finished I ran the batch file again, off of the CD image, and it ran without any errors. Any idea why an error would occur only during the install?

Link to comment
Share on other sites


If you don't provide us with information, you are unlikely to get worthy responses.

What have you added to svcpack.inf?

Is the svcpack folder source names in dosnet.inf?

Sorry about the lack of information. I'm following the instructions on the MSFN site to make an unattended XP SP2 installer, and the Windows installer (with all the current hotfixes) works fine. I've been testing it under the latest version of Virtual PC.

The error occurs right after the hotfixes finish installing and it brings a dialog box saying "Windows cannot find x. make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.", where x is the application installer. The applications are named correctly and they are in the svcpack folder. The batch file works correctly when I run it outside of the windows installer.

To svcpack.inf I added, after the hotfixes and qchain, I added my apps batch file.

Yes, I have the svcpack folder source name in dosnet.inf.

If there is anymore information that would be helpful for you guys helping me out then let me know.

Thanks.

Link to comment
Share on other sites

;Windows XP
[Version]
Signature="$Windows NT$"
MajorVersion=5
MinorVersion=1
BuildNumber=2600

[SetupData]
CatalogSubDir="\i386\SVCPACK"

[ProductCatalogsToInstall]

[SetupHotfixesToRun]
KB931261.exe /q /n /z
KB931784.exe /q /n /z
KB931836.exe /q /n /z
KB932168.exe /q /n /z
qchain.exe
apps.bat

That's my SVCPACK.inf file (though I removed most of the hotfixes to save space).

@echo off
title Batch File Applications Installer

echo.
echo Begin Installation:

echo.
echo Mozilla Firefox 2
echo Please wait...
start "Firefox" /wait "Firefox Setup 2.0.0.1.exe" /S

echo.
echo Adobe Reader 8
echo Please wait...
start "Adobe Reader" /wait "AdbeRdr80_en_US.exe" /sAll
echo Deleting Desktop Shortcut
DEL "&ALLUSERSPROFILE&\Desktop\Adobe Reader 8.Ink"

echo.
echo WinSCP
echo Please wait...
start "WinSCP" /wait "winscp382setup.exe" /sp- /silent /norestart

echo.
echo Putty
echo Please wait...
copy putty.exe "&ALLUSERSPROFILE&\Desktop\"

echo.
echo Installation Finished

echo.
echo Restarting in 60 seconds
shutdown.exe /r /f /t:60 /c "Restarting to finish application installation"

exit

And that's my apps batch file.

Edited by Patches7o9
Link to comment
Share on other sites

It still says that it cannot find the files with the error "Windows cannot find x. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search."

Maybe I should just have it run at a different stage of the installation?

Link to comment
Share on other sites

the only other problem i could see is that you dont have the exe's in the correct path.

so create a folder on the disk for install, then

@echo off
title Batch File Applications Installer
for %%i 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 %%i:\win51ip.SP2 set CDROM=%%i:
SET InstallPath=%CDROM%\Install

echo.
echo Begin Installation:

echo.
echo Mozilla Firefox 2
echo Please wait...
start "Firefox" /wait "%InstallPath%\Firefox Setup 2.0.0.1.exe" /S

echo.
echo Adobe Reader 8
echo Please wait...
start "Adobe Reader" /wait "%InstallPath%\AdbeRdr80_en_US.exe" /sAll
echo Deleting Desktop Shortcut
DEL "&ALLUSERSPROFILE&\Desktop\Adobe Reader 8.Ink"

echo.
echo WinSCP
echo Please wait...
start "WinSCP" /wait "%InstallPath%\winscp382setup.exe" /sp- /silent /norestart

echo.
echo Putty
echo Please wait...
copy %InstallPath%\putty.exe "&ALLUSERSPROFILE&\Desktop\"

echo.
echo Installation Finished

echo.
echo Restarting in 60 seconds
shutdown.exe /r /f /t:60 /c "Restarting to finish application installation"

exit

Link to comment
Share on other sites

the only other problem i could see is that you dont have the exe's in the correct path.

so create a folder on the disk for install, then

(code snip)

I find the problem really odd though, since I can run the batch script fine in any other situation, but just when the installation runs it doesn't work.

I'll try the code above and see if it works.

Thanks.

Link to comment
Share on other sites

I find the problem really odd though, since I can run the batch script fine in any other situation, but just when the installation runs it doesn't work.

I'll try the code above and see if it works.

Thanks.

when you run it manually it is running from the folder in which the installers reside, when running from svcpack.inf it is being called when the relative path is more likely c:\windows\system32 so any executable the bathc would look for it would look in that folder not your folder with the installers.

You could solve that problem by adding a change directory command to the beginning of the script.

Link to comment
Share on other sites

Thanks Patches :) Didnt realise i forgot to fix his original error (just copied and pasted the code)

Like IceMan says svcpack calls the programs from the system or system32 directory. By using a directory like the one i suggested above it means the apps install from cd and dont need to be copied to the hard drive at all. Either way its just a personal preference.

e.g.

my way

CD Layout

I386
Install
|_(Apps)
........

using svcpack alone

i386
|_SVCPACK
|__(Apps)

ou can fix the problem by adding the apps into the svcpack folder on the disk, or do as i said above and add them to the Install folder onm the disk, making the changes to the apps.bat to make the installers run from the cd.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...