Computing.Net > Forums > Programming > Batch File help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File help

Reply to Message Icon

Name: colingadd
Date: December 27, 2003 at 11:51:22 Pacific
OS: 2000 NT
CPU/Ram: pent 3, 2.61 ram
Comment:

This is really puzzling me. i have writen a .bat that xcopys a file. then runs a program. it then waits till i exit that program. then re copys a file. this is all good and works fine. here it is :-

CLS

@ECHO OFF

TITLE PROCOMM PLUS UPDATE - DONT CLOSE

ECHO.******************************************
ECHO.* PLEASE WAIT WHILE PROCOMM UPDATES.... *
ECHO.******************************************
rem from mainserver to pc
Xcopy \\Mainserver\Bureau\Masterprowin\prowin\*.key C:\prowin /D /C /Q /H /R /Y
Xcopy \\Mainserver\Bureau\Masterprowin\prowin\ASPECT C:\prowin\ASPECT /D /C /Q /H /R /Y
Xcopy \\Mainserver\Bureau\Masterprowin\prowin\dial\*.dir C:\prowin\dial\*.dir /C /Q /H /R /Y
ECHO.*****************************************
ECHO.* PLEASE DO NOT CLOSE THIS WINDOW. *
ECHO.* THIS WINDOW WILL SHUT AUTOMATICLLY *
ECHO.* WHEN PROCOMM IS CLOSED. *
ECHO.*****************************************
rem prowin run
start /MAX /wait C:\prowin\PW.exe
ECHO.******************************************
ECHO.* PROCOMM IS NOW UPDATING THE MAINSERVER *
ECHO.* WITH ANY CHANGES YOU HAVE MADE. *
ECHO.* THIS WINDOW WILL CLOSE WHEN COMPLETE *
ECHO.******************************************
rem from pc to mainserver
Xcopy C:\prowin\*.key \\Mainserver\Bureau\Masterprowin\prowin /D /C /Q /H /R /Y
Xcopy C:\prowin\ASPECT \\Mainserver\Bureau\Masterprowin\prowin\ASPECT /D /C /Q /H /R /Y
Xcopy C:\prowin\dial\*.dir \\Mainserver\Bureau\Masterprowin\prowin\dial\*.dir /C /Q /H /R /Y
exit
rem finished


i use start /max /wait "C:\prowin\pw.exe" to launch my program. this works fine and launches my program.

i then went to do exacly the same but for another program (pw4.exe)
all i did was change the command line so it launches pw4.exe.

i used start /max /wait "c:\program files\procomm plus\programs\pw4.exe" (the location of pw4)

the batch file runs ok at first it copys the files ok. but when it comes to launching pw4.exe all it dose is open another cmd window with the dir line C:\batch witch is were i launch the batch file from.

why dose it do this? how can i change it so it will launch pw4.exe. this has confussed me as the pervouse batch flie i wrote worked fine. all i have done is change the dir route. i have verified twice the dir is correct to launce pw4.exe

how can i fix this?

i hve tryed all the options given to me in start/? but no joy. i hve dubble checked that there arnt any silly mistakes.

HELP!!!

regards

colin



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: December 28, 2003 at 13:11:43 Pacific
Reply:

Try to use the short name format for the path leading to pw4.exe, so instead of

Start /Max /Wait "c:\program files\procomm plus\programs\pw4.exe"

type

Start /Max /Wait C:\Progra~1\procom~1\programs\pw4.exe

where what I showed has to be checked by repeating the Dir /X command step by step through the path, e.g.

Dir /X C:
Dir /X "C:\Program Files"

(Dir /X returns the short name format)

This way omits the " embedding the path and sometime removes the origin of mismatch.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch File help

batch file help www.computing.net/answers/programming/batch-file-help/13830.html

Batch File Help www.computing.net/answers/programming/batch-file-help-/11464.html

batch file help www.computing.net/answers/programming/batch-file-help/190.html