edit .ini file on a remote machine via batch

Microsoft Windows xp professional w/serv...
December 29, 2009 at 07:34:46
Specs: Windows XP
I need to edit a .ini file in c:\program files\xxxx on a remote machine using a batch file or com file. I am looking to enter following information.

# My project

machine.macAddress = <need to get the mac address of the machine>
machine.name = <get the host name of the remote machine where i will be editig this file>

request.timeout.default = 60

Thank you


See More: edit .ini file on a remote machine via batch

Report •


#1
January 6, 2010 at 19:35:07
I can give you part of this...........

@ECHO
TITLE=Remote INI Modification
:SET PARAM
SET DRIVEMAPLTR=T:
SET SERVER=10.12.25.77
SET REMOTEFILE=c$\Program Files\<folder>\<filename>.ini
SET USER=USER01
SET PASS=PASSWORD1


:BEGIN
REM SETUP MAPPED DRIVE
IF EXIST %DRIVEMAPLTR% ECHO Drive %DRIVEMAPLTR% Already Exists
net use %DRIVEMAPLTR% \\%SERVER%\%REMOTEDIR% /USER:%USER% %PASS%


ECHO # My project>> %DRIVEMAPLTR%\%REMOTEFILE%

REM need to get the mac address of the machine
REM THESE ARE THE COMMAND THAT YOU WOULD USE BUT THEN YOU NEED TO READ JUST MAC ADDRESS BACK IN
REM FROM THE MAC.TXT USING THE "FOR /F "TOKENS ...SYNTAX WHICH I AM AWFUL AT. SOMEONE ON THIS
REM FORUM SHOULD BE ABLE TO HOPE YOU OUT.

REM THIS CLEARS YOUR ARP CACHE
ARP -D *
REM THIS PINGS THE REMOTE SERVER SO THERE IS ONLY ONE ENTRY IN THE ARP CACHE
PING %SERVER%
REM THIS OUTPUTS THE MAC ADDRESS FROM THE ARP CACHE TO A TXT FILE
ARP -A >>MAC.TXT


rem get the host name of the remote machine where i will be editig this file
REM SAME PROCESS AS ABOVE. USE THE IPCONFIG >>IP_ADDRESS.TXT COMMAND TO OUTPUT THE IP ADDRESS INFO
REM TO A TEXT FILE AGAIN TO BE READ BACK IN USING THE FOR /F TOKENS...

REM OUTPUT VARIABLES FROM THE TWO SECTIONS THAT NEED TO BE FINISHED ABOVE.
ECHO VAR1 >>%DRIVEMAPLTR%\%REMOTEFILE%
ECHO VAR2 >>%DRIVEMAPLTR%\%REMOTEFILE%

ECHO request.timeout.default = 60 >>%DRIVEMAPLTR%\%REMOTEFILE%

GOTO EOF

:EOF
net use %DRIVEMAPLTR% /DELETE
EXIT


Report •
Related Solutions


Ask Question