Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Having issues running a certain command at command prompt

Posted on 2008-10-14
16
Medium Priority
?
831 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month20 days, 20 hours left to enroll

810 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