Solved

Having issues running a certain command at command prompt

Posted on 2008-10-14
16
814 Views
Last Modified: 2012-05-05
I have been making a batch file to copy 2 files from a CD source to the local disk. Then the batch file is supposed to run a script that will install software on the machine. I have attached the code im using. Please help me see what im doing wrong....

* The batch file works perfectly all the way up to the line I have put stars on*
@ECHO OFF

REM - THIS COPIES THE INSTALLATION AND THE SETUP INITIALIZER TO THE C:\ DRIVE

XCOPY D:\avg_ipw_stf_all_8_164a1359.exe C:\

XCOPY D:\AvgSetup.ini C:\

REM - THIS OPENS THE COMMAND PROMPT

START /MAX C:\Windows\system32\cmd.exe

REM - THIS SENDS THE COMMAND TO START THE INSTALLATION

***RUN avg_ipw_stf_all_8_164a1359.exe /SCRIPT_FILE C:\AvgSetup.ini***

REM - THIS CLOSES THE DOS PROMPT

EXIT

Open in new window

0
Comment
Question by:Zac Harris
  • 7
  • 5
  • 4
16 Comments
 
LVL 2

Expert Comment

by:devlex
Comment Utility
The problem is the RUN command, which is not a valid batch command unless it's something you've specifically put there. You should be able to take "RUN" out and have the program execute. You may have to specify the path for the avg file, but try this code.
@ECHO OFF

REM - THIS COPIES THE INSTALLATION AND THE SETUP INITIALIZER TO THE C:\ DRIVE

XCOPY D:\avg_ipw_stf_all_8_164a1359.exe C:\

XCOPY D:\AvgSetup.ini C:\

REM - THIS OPENS THE COMMAND PROMPT

START /MAX C:\Windows\system32\cmd.exe

REM - THIS SENDS THE COMMAND TO START THE INSTALLATION

avg_ipw_stf_all_8_164a1359.exe /SCRIPT_FILE C:\AvgSetup.ini

REM - THIS CLOSES THE DOS PROMPT

EXIT 

Open in new window

0
 
LVL 14

Author Comment

by:Zac Harris
Comment Utility
ok I have redone the script as you suggested and I shaved off some code because it looked like nothing was happening with it. I have attached the new code but the script file line is not launching...
@ECHO OFF

REM - THIS COPIES THE INSTALLATION AND THE SETUP INITIALIZER TO THE C:\ DRIVE

XCOPY D:\avg_ipw_stf_all_8_169a1359.exe C:\

XCOPY D:\AvgSetup.ini C:\

REM - THIS SENDS THE COMMAND TO START THE INSTALLATION

avg_ipw_stf_all_8_169a1359.exe /SCRIPT_FILE C:\AvgSetup.ini

Open in new window

0
 
LVL 2

Expert Comment

by:devlex
Comment Utility
After you run the script, can you go to C:\ and verify that the avgsetup.ini and avg_ipw_stf_all_8_169a1359.exe are both there?

I think the problem here may be that the program requires more than just these 2 files to install. The best thing to do might be to copy the entire CD to a specified folder to do the install.

Try something like this and let me know how it works:
@ECHO OFF

REM - THIS COPIES THE ENTIRE D DRIVE TO CREATED C:\AVG FOLDER

MD C:\AVG

XCOPY D:\ C:\AVG /e

REM - THIS SENDS THE COMMAND TO START THE INSTALLATION

C:\AVG\avg_ipw_stf_all_8_169a1359.exe /script_file avgsetup.ini 

Open in new window

0
 
LVL 14

Author Comment

by:Zac Harris
Comment Utility
This works great but for some reason when it gets to the part where it extracts the exe it says the file is corrupt. So i went out to the internet and re-downloaded the file and the same thing happened. I even changed the path to copy the files from on of our servers to the c: drive of the computer. Any ideas?
0
 
LVL 2

Expert Comment

by:devlex
Comment Utility
It's saying the file is corrupt inside of the avg installation, or as part of the copy process from the batch file?

Try adding the /h switch to the xcopy command, maybe there's a hidden file that it's missing and is holding up the install.

If it's failing within the actual installation, there may be a problem with your avgsetup.ini file. If this is the case, could you include the contents of that file?
@ECHO OFF

REM - THIS COPIES THE ENTIRE D DRIVE TO CREATED C:\AVG FOLDER

MD C:\AVG

XCOPY D:\ C:\AVG /e/h

REM - THIS SENDS THE COMMAND TO START THE INSTALLATION

C:\AVG\avg_ipw_stf_all_8_169a1359.exe /script_file avgsetup.ini 

Open in new window

0
 
LVL 14

Author Comment

by:Zac Harris
Comment Utility
Same problem... here is the contents of the avgsetup.ini file as requested...



HIDE:

RESTART_DELAY: 600

LICNO_CODED: "PCtruc+ZA9cVYMKGLkn2O/0VVVkfvjbzMzDsp6I6/TEKnozlde3FIoNdRUdKpYvk8fybZ5JRER/c+8888PmYgESG92VIVE7jxAIPaCJElsg=" 

KILL_PROCESS_IF_NEEDED:

DCPATH: "CULLMANDC:4158" 

UPDATE_SERVER: "|+http://CULLMANDC:4158/avgupdate|+http://update.avg.com/softw/80/update/|+http://backup.avg.cz/softw/80/update/|" 

NOAVGTOOLBAR:

ADD_FEATURE: fea_AVG_HttpScanner

ADD_FEATURE: fea_AVG_SafeSurf

ADD_FEATURE: fea_AVG_SafeSearch

ADD_FEATURE: fea_AVG_Language_JP

ADD_FEATURE: fea_AVG_Language_US

ADD_FEATURE: fea_AVG_Exchange_plugin

ADD_FEATURE: fea_AVG_Office_2000_plugin

ADD_FEATURE: fea_AVG_Cl

REMOVE_FEATURE: fea_AVG_Firewall

REMOVE_FEATURE: fea_AVG_Language_CS

REMOVE_FEATURE: fea_AVG_Language_CZ

REMOVE_FEATURE: fea_AVG_Language_FR

REMOVE_FEATURE: fea_AVG_Language_GE

REMOVE_FEATURE: fea_AVG_Language_HU

REMOVE_FEATURE: fea_AVG_Language_IT

REMOVE_FEATURE: fea_AVG_Language_NL

REMOVE_FEATURE: fea_AVG_Language_PB

REMOVE_FEATURE: fea_AVG_Language_PT

REMOVE_FEATURE: fea_AVG_Language_PL

REMOVE_FEATURE: fea_AVG_Language_SC

REMOVE_FEATURE: fea_AVG_Language_SK

REMOVE_FEATURE: fea_AVG_Language_SP

REMOVE_FEATURE: fea_AVG_Language_DA

REMOVE_FEATURE: fea_AVG_Bat_plugin

REMOVE_FEATURE: fea_AVG_EMC

Open in new window

0
 
LVL 2

Accepted Solution

by:
devlex earned 125 total points
Comment Utility
The .ini file looks good, it's possible that one of the files may be corrupt. Try adding this line to your avgsetup.ini file

LOG: "C:\avg\install.LOG"

That should create an install.log file that tells you why it's failing.
HIDE:

RESTART_DELAY: 600

LOG: "C:\avg\avginstall.LOG"

LICNO_CODED: "PCtruc+ZA9cVYMKGLkn2O/0VVVkfvjbzMzDsp6I6/TEKnozlde3FIoNdRUdKpYvk8fybZ5JRER/c+8888PmYgESG92VIVE7jxAIPaCJElsg=" 

KILL_PROCESS_IF_NEEDED:

DCPATH: "CULLMANDC:4158" 

UPDATE_SERVER: "|+http://CULLMANDC:4158/avgupdate|+http://update.avg.com/softw/80/update/|+http://backup.avg.cz/softw/80/update/|" 

NOAVGTOOLBAR:

ADD_FEATURE: fea_AVG_HttpScanner

ADD_FEATURE: fea_AVG_SafeSurf

ADD_FEATURE: fea_AVG_SafeSearch

ADD_FEATURE: fea_AVG_Language_JP

ADD_FEATURE: fea_AVG_Language_US

ADD_FEATURE: fea_AVG_Exchange_plugin

ADD_FEATURE: fea_AVG_Office_2000_plugin

ADD_FEATURE: fea_AVG_Cl

REMOVE_FEATURE: fea_AVG_Firewall

REMOVE_FEATURE: fea_AVG_Language_CS

REMOVE_FEATURE: fea_AVG_Language_CZ

REMOVE_FEATURE: fea_AVG_Language_FR

REMOVE_FEATURE: fea_AVG_Language_GE

REMOVE_FEATURE: fea_AVG_Language_HU

REMOVE_FEATURE: fea_AVG_Language_IT

REMOVE_FEATURE: fea_AVG_Language_NL

REMOVE_FEATURE: fea_AVG_Language_PB

REMOVE_FEATURE: fea_AVG_Language_PT

REMOVE_FEATURE: fea_AVG_Language_PL

REMOVE_FEATURE: fea_AVG_Language_SC

REMOVE_FEATURE: fea_AVG_Language_SK

REMOVE_FEATURE: fea_AVG_Language_SP

REMOVE_FEATURE: fea_AVG_Language_DA

REMOVE_FEATURE: fea_AVG_Bat_plugin

REMOVE_FEATURE: fea_AVG_EMC

Open in new window

0
 
LVL 21

Expert Comment

by:AmazingTech
Comment Utility
From your original code it is unclear where you are starting from.

Run your command with the drive letter.
@ECHO OFF

REM - THIS COPIES THE INSTALLATION AND THE SETUP INITIALIZER TO THE C:\ DRIVE

XCOPY D:\avg_ipw_stf_all_8_164a1359.exe C:\

XCOPY D:\AvgSetup.ini C:\

REM - THIS OPENS THE COMMAND PROMPT

START /MAX C:\Windows\system32\cmd.exe

REM - THIS SENDS THE COMMAND TO START THE INSTALLATION

C:\avg_ipw_stf_all_8_164a1359.exe /SCRIPT_FILE C:\AvgSetup.ini

REM - THIS CLOSES THE DOS PROMPT

EXIT

Open in new window

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 14

Author Comment

by:Zac Harris
Comment Utility
AmazingTech:

I have changed from that coding to the one attached. I realized not everyone will have this cd so I changed the source location to a server location (I have included the new code) I also removed the open DOS prompt option because it wasnt needed. Right now the script works flwlessly until it goes to extract the setup files from the exe file. When it tries to extract it says the file is corrupt. I re-downloaded the file and the same issue persists. I also added a switch to the code at the advice of devlex to include hidden files. Same problem. Any ideas?
@ECHO OFF

REM - THIS COPIES THE SOURCE FILES TO CREATED C:\AVG FOLDER

MD C:\AVG

XCOPY \\srv03\public\avg\ C:\AVG /e/h

REM - THIS SENDS THE COMMAND TO START THE INSTALLATION

C:\AVG\avg_ipw_stf_all_8_169a1359.exe /script_file avgsetup.ini 

Open in new window

0
 
LVL 2

Expert Comment

by:devlex
Comment Utility
Have you tried running it without the /script_file switch? That would at least rule out the .ini file as the problem.
0
 
LVL 21

Expert Comment

by:AmazingTech
Comment Utility
What's in the avgsetup.ini?
0
 
LVL 21

Expert Comment

by:AmazingTech
Comment Utility
obscure any data this serial number if you're going to post your avgsetup.ini file.
0
 
LVL 14

Author Comment

by:Zac Harris
Comment Utility
AmazingTech I have attached the contents of the .ini file.  
HIDE:

RESTART_DELAY: 600

LICNO_CODED: "PCtruc+ZA9cVYMKGLkn2O/0VVVkfvjbzMzDsp6I6/TEKnozlde3FIoNdRUdKpYvk8fybZ5JRER/c+8888PmYgESG92VIVE7jxAIPaCJElsg=" 

KILL_PROCESS_IF_NEEDED:

DCPATH: "CULLMANDC:4158" 

UPDATE_SERVER: "|+http://CULLMANDC:4158/avgupdate|+http://update.avg.com/softw/80/update/|+http://backup.avg.cz/softw/80/update/|" 

NOAVGTOOLBAR:

ADD_FEATURE: fea_AVG_HttpScanner

ADD_FEATURE: fea_AVG_SafeSurf

ADD_FEATURE: fea_AVG_SafeSearch

ADD_FEATURE: fea_AVG_Language_JP

ADD_FEATURE: fea_AVG_Language_US

ADD_FEATURE: fea_AVG_Exchange_plugin

ADD_FEATURE: fea_AVG_Office_2000_plugin

ADD_FEATURE: fea_AVG_Cl

REMOVE_FEATURE: fea_AVG_Firewall

REMOVE_FEATURE: fea_AVG_Language_CS

REMOVE_FEATURE: fea_AVG_Language_CZ

REMOVE_FEATURE: fea_AVG_Language_FR

REMOVE_FEATURE: fea_AVG_Language_GE

REMOVE_FEATURE: fea_AVG_Language_HU

REMOVE_FEATURE: fea_AVG_Language_IT

REMOVE_FEATURE: fea_AVG_Language_NL

REMOVE_FEATURE: fea_AVG_Language_PB

REMOVE_FEATURE: fea_AVG_Language_PT

REMOVE_FEATURE: fea_AVG_Language_PL

REMOVE_FEATURE: fea_AVG_Language_SC

REMOVE_FEATURE: fea_AVG_Language_SK

REMOVE_FEATURE: fea_AVG_Language_SP

REMOVE_FEATURE: fea_AVG_Language_DA

REMOVE_FEATURE: fea_AVG_Bat_plugin

REMOVE_FEATURE: fea_AVG_EMC

Open in new window

0
 
LVL 21

Expert Comment

by:AmazingTech
Comment Utility
Specify full path to the script file.
@ECHO OFF

REM - THIS COPIES THE SOURCE FILES TO CREATED C:\AVG FOLDER

MD C:\AVG

XCOPY \\srv03\public\avg\ C:\AVG /e/h

REM - THIS SENDS THE COMMAND TO START THE INSTALLATION

C:\AVG\avg_ipw_stf_all_8_169a1359.exe /script_file C:\AVG\avgsetup.ini

Open in new window

0
 
LVL 14

Author Comment

by:Zac Harris
Comment Utility
Thanks  Im now leaning more toward a hardware problem rather than the script being wrong because other programs are acting up. I inherited this pc from a previous user and they messed it up bad with tweaking settings.Ill update as soon as I replace the hardware this afternoon
0
 
LVL 14

Author Closing Comment

by:Zac Harris
Comment Utility
EXCELLENT! Thanks
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now