[Show all top banners]

secondlife
Replies to this thread:

More by secondlife
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 URGENT: Computer (code) Help
[VIEWED 7244 TIMES]
SAVE! for ease of future access.
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)

 
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

 
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 

 
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

 
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

 
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


 
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


 
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..

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 365 days
Recommended Popular Threads Controvertial Threads
NRN card pros and cons?
TPS Re-registration case still pending ..
ANA and AJAY KUMAR DEV. RAPISTS CONVENTION
tesla stock OMG !!
TPS for Nepal likely to extend next week
Conservative discussions
सालीको चाक
TPS To F-1 COS
Embassy of Nepal might be able to help extend TPS for Nepal
Homeland Security revokes temporary status for 532,000 Cubans, Haitians, Nicaraguans and Venezuelans
Venezuela TPS lawuit
ChatSansar.com Naya Nepal Chat
Who is hottest nepali female?
Looking for girl
TPS for Venezuela is terminated, only 60 days extension for transition period
TPS to F1 Status.
Nepal TPS has been Extended !!!
legal Query for married nepali girl now have taken US citizenship
Got my F1 reinstatement approved within 3 months(was out of F1 for almost 2 years)
रबि लामिछानेको दाहिने हात ICE को हिरासतमा
Looking for girl
Who is hottest nepali female?
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters