Search found 7 matches

by Goomba79
04 Dec 2012 08:50
Forum: DOS Batch Forum
Topic: Changing a line in file using a batch file
Replies: 14
Views: 6849

Re: Changing a line in file using a batch file

That's got it working!
Thanks alot, will save me alot of time in not messing about changing to file path manually!
Thanks!!!!!! :P
by Goomba79
04 Dec 2012 08:33
Forum: DOS Batch Forum
Topic: Changing a line in file using a batch file
Replies: 14
Views: 6849

Re: Changing a line in file using a batch file

Hello, I want it to work as abc0502 has stated. the file company isnt a text file it is just listed as a file (its isn't called company.txt, just company) i have to open it with notedpad to see the contents. It is a file that the accounts program, sage, looks at and is pointed to the location of the...
by Goomba79
04 Dec 2012 07:54
Forum: DOS Batch Forum
Topic: Changing a line in file using a batch file
Replies: 14
Views: 6849

Re: Changing a line in file using a batch file

hello again.

it is plain text.
when i open the file using notepad (right click open with) all thats in the file is the text S:\Accounts

I cant upload the file unfortunatly as the companys firewall blocks file sharing sites. :x
by Goomba79
04 Dec 2012 06:59
Forum: DOS Batch Forum
Topic: Changing a line in file using a batch file
Replies: 14
Views: 6849

Re: Changing a line in file using a batch file

Thanks for the reply Foxidrive,

I gave that a go but unfotunately it didnt work.

could it be because what im trying to edit isnt a txt file its just listed as 'file' as the type?

you can open it with notepad to see the contents.

Thanks again,

iain
by Goomba79
04 Dec 2012 06:34
Forum: DOS Batch Forum
Topic: Changing a line in file using a batch file
Replies: 14
Views: 6849

Re: Changing a line in file using a batch file

from looking at it it looks as though it will just change s:\accounts to \\sage\SG50Acc$\Data\ i need it to look at whats there and swap to the other, maybe using an if staement? if text in file = S:\Accounts then text in file = \\sage\SG50Acc$\Data\ elseif text in file = \\sage\SG50Acc$\Data\ then ...
by Goomba79
04 Dec 2012 06:27
Forum: DOS Batch Forum
Topic: Changing a line in file using a batch file
Replies: 14
Views: 6849

Re: Changing a line in file using a batch file

Hello, there are no blank lines in the file just the a line that will either be S:\Accounts or \\SAGE\SG50Acc$\Data\ my company has 2 versions of sage and point to different locations (the file paths above) so i want the batch file to change the file so so the user can swap between sage locations! I...
by Goomba79
04 Dec 2012 06:07
Forum: DOS Batch Forum
Topic: Changing a line in file using a batch file
Replies: 14
Views: 6849

Changing a line in file using a batch file

Hello, I'm trying to make a batch file to change a line of text in a file depending what the line is.... I have written this bit of code (with the help of google) but it doesnt work! Set objFS = CreateObject("Scripting.FileSystemObject") strFile = "C:\ProgramData\Sage\Company.txt"...