ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

need a quick fix for something easy. Script to change a single word in text file


Posted in another place but might get answer here too.  Need to figure out asap.

I have a program that has a config file inside "/programdata/myprog/" so no one can "see" it unless they have access to hidden files.  It needs to be edited anyway and that cant be done unless they have admin rights.
The file points the user to the correct IP address for the program to work.  I already tried making batch/shortcut with admin and evn tried run as admin (for those who called and asked)

This worked for ME and for some people but not for others.  When I check their copy of "getthere.cfg" it is still the old one.

I need to edit their "getthere.cfg" file to change the only occurrence of an IP (example)"" to IP "".  These people are located all over the place and so far I have had to connect to each of them with Teamviewer or other and do it for them.

How can I send them a script that will run "as admin" on their system to open "c:\programdata\myprog\getthere.cfg" and change that ONE IP address.

Even if I send them the new config file they can't insert it without having admin privileges and I would never tell any of them how to get that :down: ;)

And it has to be a one click fix.  Trust me, that is all they can handle.


OMG!  I solved the problem and I knew there would be a "DUH" factor in it but this one is so big I almost cannot believe it!  Problem solved and I even found others researching how to do this on other forums so I don't feel so bad.  As I expected, I was trying way to hard. 

Solution:  Take the corrected file, Zip it with regular windows 8 compress.  Attach it to an email to send who needs it, they save attachment to desktop (or anywhere). Right click and choose extract and the next step was the solution.

Just change the destination to be c:\programdata\foldername\.  The fact that it neither needed nor asked for any permissions to do this is what I could not believe as this is a hidden folder that needs admin permission to even edit files already there.  Yet it allows you to overwrite the old one with the new one and only has the normal "YES, Overwrite" option no matter who you are apparently.
Anyway, thanks to all those who read and any who offered options  I am sure that the other solutions will come in handy one day but for now, I know how to write files to a hidden protected folder no matter who I am.  Just extract them there.  :)  I even tried putting a copy in c:\windows\system32 just to see what it would do and the worst I got no matter where I chose was a window asking permission to proceed.  it went there every time.   In case anyone ever needs to get files to somewhere they normally can't.

I'm not so sure this actually is going to work on all computers. I must assume that most have UAC in the default setting, so it won't allow 'just any application' to write in system-reserved directories.
Is UAC turned off, or are you testing on Windows XP (but that's unlikely when you mention "C:\ProgramData") ?


[0] Message Index

Go to full version