Solved

Having issues running a certain command at command prompt

Posted on 2008-10-14
16
823 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
ID: 22711528
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
ID: 22711885
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
ID: 22712165
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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 14

Author Comment

by:Zac Harris
ID: 22712680
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
ID: 22712788
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
ID: 22712902
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
ID: 22713150
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
ID: 22713751
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
 
LVL 14

Author Comment

by:Zac Harris
ID: 22713940
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
ID: 22713968
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
ID: 22713981
What's in the avgsetup.ini?
0
 
LVL 21

Expert Comment

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

Author Comment

by:Zac Harris
ID: 22714242
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
ID: 22714816
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
ID: 22714895
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
ID: 31505892
EXCELLENT! Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
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 look for a specific file type in a local or remote server directory using PHP.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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