Solved

Create batch file for run the application and kill the application

Posted on 2013-07-02
8
1,262 Views
Last Modified: 2013-07-03
Hello,

we deployed SAP GUI on all our PCs but we need to copy the ini configuration file to specific location but the problem this location did not exist until the SAP run for the first time after that you can find the path and copy the file.

so i want to create a script file to run the application and close it or kill i the copy the ini file to to the specific location (the file should be replaced with the new one)

Can we do it ?

Regards,
0
Comment
Question by:fadyaz
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39292511
hello again.

do u want the script to wait till the installation is over and then copy the .ini file to the asp gui location folder?
0
 
LVL 2

Author Comment

by:fadyaz
ID: 39292650
yes. but the path to be exist the application need to run first then we can copy the file on this location.
0
 
LVL 17

Expert Comment

by:Lior Karasenti
ID: 39292713
What is the location to which you need to copy the INI to? Please post the complete path and the name of the INI file.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 2

Author Comment

by:fadyaz
ID: 39292918
The File Name : saplogon.ini

The Path : %appdata%\sap\Common\
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 39292937
I suppose it is sufficient to create that folder, copy the SAPLogon.INI, and then start the SAP Logon.
@echo off
xcopy \\server\share\saplogon.ini "%appdata%\sap\Common\"

Open in new window

0
 
LVL 2

Author Comment

by:fadyaz
ID: 39293046
I created the below script to install the SAP and then to run the application and kill it then start copying the file . can you check it and help me to the modification.

but i need to the last three steps run only when the installation finish
@echo off

\\Server\50118243_6\NW_7.0_Presentation_\PRES1\GUI\WINDOWS\WIN32\Setup\NwSapSetup.exe /Silent /Product="SAPGUI710"

start /d "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\" saplogon.exe
taskkill /f /im saplogon.exe
copy "\\sharefolder\SAP Batch\saplogon.ini" "%appdata%\sap\Common\"

@echo off

Open in new window

0
 
LVL 69

Expert Comment

by:Qlemo
ID: 39293099
You can try to insert
if errorlevel 1 exit /b

Open in new window

before line 5. The installer needs to return an error code for this to work.

Are you sure you can't just copy the ini, then try to install?
0
 
LVL 17

Accepted Solution

by:
Lior Karasenti earned 500 total points
ID: 39293228
The following code should work:
@echo off

\\Server\50118243_6\NW_7.0_Presentation_\PRES1\GUI\WINDOWS\WIN32\Setup\NwSapSetup.exe /Silent /Product="SAPGUI710"

md "%appdata%\sap\Common"
copy "\\sharefolder\SAP Batch\saplogon.ini" "%appdata%\sap\Common\"

start /d "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\" saplogon.exe

Open in new window

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
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 …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

785 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