[VIEWED 4667
TIMES]
|
SAVE! for ease of future access.
|
|
|
secondlife
Please log in to subscribe to secondlife's postings.
Posted on 08-20-09 10:38
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Hey Sajha Computer Gurus,
I am new to programming , pls help.. help.
I have a makefile.exe program that takes a file(.txt ) format and changes to different format (.ms). it works in command line(DOS) like this C:\> makefile.exe filename.txt -ms ( it creats filename.ms),
But I have to run several( thousands) of those .txt file that need to be change in .ms format. I am wondering how can I give a command so that the it works automatically for all the text file that are in a folder. i am looking some line of codes (in any programming languge) batch file or in command line mode.
I really need this urgently,
Thanks, Slife
(FYI: file names are format are not real)
|
|
|
|
pyaradeshbasiharu
Please log in to subscribe to pyaradeshbasiharu's postings.
Posted on 08-20-09 10:49
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Try reading the files in vbcsript,,
create a loop to read the file in a folder once the file is read, fire makefile.exe filename.txt -ms
do until there is no file in the folder..
simple
|
|
|
pyaradeshbasiharu
Please log in to subscribe to pyaradeshbasiharu's postings.
Posted on 08-20-09 11:01
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Just to make ur life easier Set objFSO = CreateObject("Scripting.FileSystemObject") objStartFolder = "C:\Scripts"
Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files For Each objFile in colFiles 'ur command to create .ms file goes here 'eg wscript.run makefile.exe filename.txt -ms Next
Disclaimer: not a fullcode
|
|
|
secondlife
Please log in to subscribe to secondlife's postings.
Posted on 08-20-09 11:03
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Payaradeshbashiharu,
Thanks for your quick response, can you pls provide me few more line of code(would be great if it's complete). I have no idea about vb script... though i have visual studio in my system. pls
Thanks slife
|
|
|
pyaradeshbasiharu
Please log in to subscribe to pyaradeshbasiharu's postings.
Posted on 08-20-09 11:14
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Dim aWSHShell, bWSHShell ,c Set aWSHShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") objStartFolder = "C:\Scripts" 'Ur folder path
Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files For Each objFile in colFiles c=objFile.Name 'variable to hold file name aWSHShell.Run "makefile.exe c -ms " Next
I don't have a Windows Box ...and haven't tested it ..but if there's any error minor tweak will do the trick..
save the above code with .vbs extension..to execute the code simply right click and open it...
hope it helps u
|
|
|
secondlife
Please log in to subscribe to secondlife's postings.
Posted on 08-21-09 12:02
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Payaradeshbashiharu,
Thanks alot for your great help, It worked (made some modification), but it just gave me one output(just for 1 file) as i mentioned earlier i need a loop so that it should do for all the file.
how to make just read 1 file at a time and modify that and take next file................... ?
Cheers!
I really appreciate your help and humbled by your support
Slife
|
|
|
secondlife
Please log in to subscribe to secondlife's postings.
Posted on 08-21-09 10:24
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
pyaradeshbasiharu, Thanks for all your support, though it created a file on required format, it's just a templete( just ~50kb size) actually it should be bigger one. and also I need the .ms file name same as .txt file. complete code would be great, thanks a lot. Cheers! slife
|
|
|
pyaradeshbasiharu
Please log in to subscribe to pyaradeshbasiharu's postings.
Posted on 08-21-09 11:23
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
U will get the Answer here...Look at "Changing File Extensions"..Minor tweaks in program will help u..
|
|