Jump to content

Windows can't find path for programs


archmonde11

Recommended Posts

I'm trying to silently install some InstallShield based programs. I use the following *.cmd file executed by runoneex. The Runoneex worked fine but the error arose when executing Others.cmd. A window appear notifying that Windows can not find the path for those programs. To clear this out, I Iogged on window XP, run the same *.exe which was used in Others.cmd by Run command with and without /s switch. The fact is that If I execute the *.exe with the /s, the same window notifying missing path appeared like the beginning. Anyone encountered the same problem?

RUNONEEX


...
REG ADD %KEY%\0004 /VE /D "Other Programs" /f
REG ADD %KEY%\0004 /V 0001 /D "%CDROM%\Apps\Others.cmd" /f

Ohers.cmd

CLS
@echo off
TITLE Windows XP SP3 - Unattended Installation

ECHO.
ECHO Installing Unikey 4.0
ECHO Please wait...
start /wait %CDROM%\Apps\UKEY4.0\Unikey4.0.exe /s

ECHO.
ECHO Installing WinRAR 3.2
ECHO Please wait...
start /wait %CDROM%\Apps\winrar3.2\winrar3.2.exe /s

ECHO.
ECHO Installing Foxit Reader 3.0
ECHO Please wait...
start /wait %CDROM%\Apps\Foxit Reader3\FoxitRead3.exe /s

ECHO.
ECHO Installing Copy File name 3.1
ECHO Please wait...
start /wait %CDROM%\Apps\CopyFilename31\copyfilenames31.exe /s

ECHO.
ECHO Restarting the PC in 30 seconds...
shutdown.exe -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"

EXIT

Link to comment
Share on other sites


you didnt put the variable to find cdrom its like in runonceex when you put "SET CDROM=%%i:"

use SetLocal enableextensions to local variables.

Ohers.cmd

CLS

@echo off

TITLE Windows XP SP3 - Unattended Installation

SetLocal enableextensions

SET CDROM=%~d0\Apps\

ECHO.

ECHO Installing Unikey 4.0

ECHO Please wait...

start /wait %CDROM%UKEY4.0\Unikey4.0.exe /s

ECHO.

ECHO Installing WinRAR 3.2

ECHO Please wait...

start /wait %CDROM%winrar3.2\winrar3.2.exe /s

ECHO.

ECHO Installing Foxit Reader 3.0

ECHO Please wait...

start /wait %CDROM%Foxit Reader3\FoxitRead3.exe /s

ECHO.

ECHO Installing Copy File name 3.1

ECHO Please wait...

start /wait %CDROM%CopyFilename31\copyfilenames31.exe /s

ECHO.

ECHO Restarting the PC in 30 seconds...

shutdown.exe -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"

EndLocal

EXIT

Edited by RTK999
Link to comment
Share on other sites

@ECHO OFF & SETLOCAL ENABLEEXTENSIONS
TITLE Windows XP SP3 - Unattended Installation

(SET CDROM=%~d0)

CLS

ECHO=
ECHO=Installing Unikey 4.0
ECHO=Please wait...
START /WAIT %CDROM%\Apps\UKEY4.0\Unikey4.0.exe /s

ECHO=
ECHO=Installing WinRAR 3.2
ECHO=Please wait...
START /WAIT %CDROM%\Apps\winrar3.2\winrar3.2.exe /s

ECHO=
ECHO=Installing Foxit Reader 3.0
ECHO=Please wait...
START "" /WAIT "%CDROM%\Apps\Foxit Reader3\FoxitRead3.exe" /s

ECHO=
ECHO=Installing Copy File name 3.1
ECHO=Please wait...
START /WAIT %CDROM%\Apps\CopyFilename31\copyfilenames31.exe /s

ECHO=
ECHO=Restarting the PC in 30 seconds...
SHUTDOWN.EXE -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"

EXIT

Link to comment
Share on other sites

Usually "start " command need a title to work properly, so i would fix this also.

The start command would only require the 'title' double-quotes in the single case where I've provided them in my re-write above. This was because archmonde11's example command needed quoting due to the space in their path on that line and without the title, that quoted string may be mistaken for one.

Link to comment
Share on other sites

@ECHO OFF & SETLOCAL ENABLEEXTENSIONS
TITLE Windows XP SP3 - Unattended Installation

(SET CDROM=%~d0)

CLS

ECHO=
ECHO=Installing Unikey 4.0
ECHO=Please wait...
START /WAIT %CDROM%\Apps\UKEY4.0\Unikey4.0.exe /s

ECHO=
ECHO=Installing WinRAR 3.2
ECHO=Please wait...
START /WAIT %CDROM%\Apps\winrar3.2\winrar3.2.exe /s

ECHO=
ECHO=Installing Foxit Reader 3.0
ECHO=Please wait...
START "" /WAIT "%CDROM%\Apps\Foxit Reader3\FoxitRead3.exe" /s

ECHO=
ECHO=Installing Copy File name 3.1
ECHO=Please wait...
START /WAIT %CDROM%\Apps\CopyFilename31\copyfilenames31.exe /s

ECHO=
ECHO=Restarting the PC in 30 seconds...
SHUTDOWN.EXE -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"

EXIT

you miss EndLocal to work properly.

Link to comment
Share on other sites

Thanks all of you for your replies. Finally I have this others.cmd. It worked like charm! This forum is so GREAT!

@ECHO OFF & SETLOCAL ENABLEEXTENSIONS
TITLE Windows XP SP3 - Unattended Installation

(SET CDROM=%~d0)

CLS

ECHO=
ECHO=Installing Unikey 4.0
ECHO=Please wait...
START /WAIT %CDROM%\Apps\UKEY4.0\Unikey4.0.exe /s

ECHO=
ECHO=Installing WinRAR 3.2
ECHO=Please wait...
START /WAIT %CDROM%\Apps\winrar3.2\winrar3.2.exe /s

ECHO=
ECHO=Installing Foxit Reader 3.0
ECHO=Please wait...
START "" /WAIT "%CDROM%\Apps\Foxit Reader3\FoxitRead3.exe" /s

ECHO=
ECHO=Installing Copy File name 3.1
ECHO=Please wait...
START /WAIT %CDROM%\Apps\CopyFilename31\copyfilenames31.exe /s

ECHO=
ECHO=Restarting the PC in 30 seconds...
SHUTDOWN.EXE -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"

EndLocal

EXIT

Link to comment
Share on other sites

you miss EndLocal to work properly.

May I ask WHY? :unsure:

jaclaz

will work anyway but if you have another functions or batch files in the same script could interfere with those functions 'cause setlocal will continues until find endlocal command.

Link to comment
Share on other sites

will work anyway but if you have another functions or batch files in the same script could interfere with those functions 'cause setlocal will continues until find endlocal command.

Well, that is a possibility :), but since it is right before an EXIT (which in my view is also not *really*needed :ph34r: ) and right after a SHUTDOWN command :whistle: , I doubt the specific batch won't "work properly". :blink:

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

will work anyway but if you have another functions or batch files in the same script could interfere with those functions 'cause setlocal will continues until find endlocal command.

Well, that is a possibility :), but since it is right before an EXIT (which in my view is also not *really*needed :ph34r: ) and right after a SHUTDOWN command :whistle: , I doubt the specific batch won't "work properly". :blink:

jaclaz

yes but sometimes i'm going adding new code to the script, that 'cause, but whatever, anyone could make thing the way they like it.

Link to comment
Share on other sites

yes but sometimes i'm going adding new code to the script, that 'cause, but whatever, anyone could make thing the way they like it.

Sure :) just trying to:

http://en.wikiquote.org/wiki/Albert_Einstein

It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience.

"On the Method of Theoretical Physics" The Herbert Spencer Lecture, delivered at Oxford (10 June 1933); also published in Philosophy of Science, Vol. 1, No. 2 (April 1934), pp. 163-169. [thanks to Dr. Techie @ www.wordorigins.org and JSTOR]

Variants: Everything should be made as simple as possible, but no simpler.

Everything should be made as simple as possible, but not simpler.

This is very similar to "Occam's Razor", with the addition that it warns about too much simplicity. Dubbed ''Einstein's razor, it is used when an appeal to Occam's razor results in an over-simplified explanation insufficient to meet needs or goals. It is also similar to one expression of what has become known as the "KISS principle": Keep It Simple, Stupid — but never oversimplify.

:thumbup

jaclaz

Link to comment
Share on other sites

As jaclaz said, not only was the ENDLOCAL not required neither was the EXIT command, (I only added it so that the Topic starter would recognise that it was effectively still their entire file and prevent them from messing with it).

RTK999 even with the non-required last line the script I provided would have worked perfectly, yours however would not. Also If changing the CDROM variable as you did, Id have preferred to have seen you use: (SET CDROM=%~dp0)

Based on the level of knowledge shown by the Topic starter, I'd be inclined to advise against them adding additional code to the script. It'd likely require debugging to work properly and we're not here to debug a script at several stages through its development.

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...