batch files.. please help me!!

Soldato
Joined
25 Oct 2002
Posts
4,198
Location
Derbyshire
Is it possible to make a .bat file to open a text file, remove old text and paste new?

At work we have 2 systems, A and B. To get data from a to b we have to copy from A, open a file with no extention (click on it then select notepad as the always open with box is greyed out) , ctrl+A, ctrl+V, save as and then open B and import.

Ive made by guessing a .bat to open the file with no extention direct into notepad, can you guys help with the rest??

Code so far :) this seems to work but i've realy no idea if its right.
Code:
C:\WINDOWS\notepad.exe "C:\work related folder\Work File"


Oh and how do you make the dos window close after its opened notepad? It closes when i close notepad but not before.
 
Thank you very much

Which bit do i edit to add my file?


Just change C:\Helpdesk\Test.txt to C:\work related folder\Work File?
 
Tried it anyway and it works!

Fantastic mate :) gona save me about an hour a week in pointless waiting :)


Is there anyway of adding a little splash screen saying something like 'please wait'?

I work with an older gentleman (sat near me ;) ) who bangs at the link 30 times thinking its not working lol
 
Just dug this thread up to ask another question and noticed i never said thanks!! :eek:

Anyway



THANKS!!! ;)



My question was that if no info is in the clipboard it throws up an error (understandable) but can the error be re used to say something like 'run the macro first fool!' ?
 
Hey thanks, this is good stuff!

Roy (the older bloke) didn't run the marco taday and got a shock :D


Can you alter the icon in the warning box?
 
Me again!!

Since you great folk are saving me so much time doing the duff stuff at work i'm gona ask for your help again.

Every day i get emailed 4 files and every day they are called the same thing (say fileA.txt, fileB.txt etc....)

We save each of the 4 files as another name (meat.txt, produce.txt, Chilled.txt, produce chill.txt) so the xl work sheets understand them.


We also get a printout of the FileA/b/c.txt sheets as backups that sit in a folder 1 month then get binned.

I want to do away with the paper copy as it's such a waste and for the 2-3 times a month we ever look at them we could print as needed.


Ok.

What i'm after is something that can copy and save with a dated name the files saved. So Meat.txt becames MEAT041206.txt and saves into a new folder on c drive. So every day i get the email, save as and run the file to create a backup.

Can this be done? and can it do all files at the same time?
 
Back
Top Bottom