Solved

adding a port entry into c:\windows\system32\drivers\etc\services

Posted on 2011-03-03
5
2,523 Views
Last Modified: 2012-05-11
I am writing a batch file to bring together the various exe running and file copy procedures of installing an application. One of the stages involdes adding the entry ;
esri_sde 5151/tcp        #Reference to Grouch SDE
at the end of c:\windows\system32\drivers\etc\services
Is there a simple way of scripting this?
0
Comment
Question by:SYPTE-IT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 3

Assisted Solution

by:OrenRozen
OrenRozen earned 125 total points
ID: 35028846
hi,

the command is :

echo esri_sde 5151/tcp        #Reference to Grouch SDE >> services

0
 
LVL 3

Assisted Solution

by:OrenRozen
OrenRozen earned 125 total points
ID: 35028864
another thing, to do the same for every location changes services to the full path:
C:\Windows\System32\drivers\etc\services

thanks.
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 125 total points
ID: 35028913
Or better to deal with c:\winnt, c:\windows etc:

@echo off
set services="%SystemRoot%\system32\drivers\etc\services"
find "esri_sde" %services% || echo esri_sde 5151/tcp        #Reference to Grouch SDE >> %services%

That will check using find if the entry is in services and if not add it.

Steve
0
 
LVL 1

Author Closing Comment

by:SYPTE-IT
ID: 35028952
Thanks, so much more simple than all those C## etc scripts I found with google!
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 35029090
No problem... obviously it will need to be run with suitable admin rights to the file... but easy is good in my eyes!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

624 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