[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 3798 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 60 days
Recommended Popular Threads Controvertial Threads
What are your first memories of when Nepal Television Began?
निगुरो थाहा छ ??
Basnet or Basnyat ??
Sajha has turned into MAGATs nest
TPS Re-registration case still pending ..
Nas and The Bokas: Coming to a Night Club near you
मन भित्र को पत्रै पत्र!
काेराेना सङ्क्रमणबाट बच्न Immunity बढाउन के के खाने ?How to increase immunity against COVID - 19?
TPS Work Permit/How long your took?
Breathe in. Breathe out.
Guess how many vaccines a one year old baby is given
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
चितवनको होस्टलमा १३ वर्षीया शालिन पोखरेल झुण्डिएको अवस्था - बलात्कार पछि हत्याको शंका - होस्टेलहरु असुरक्षित
शीर्षक जे पनि हुन सक्छ।
Travelling to Nepal - TPS AP- PASSPORT
Nepali doctors future black or white usa ?
Doctors dying suddenly or unexpectedly since the rollout of COVID-19 vaccines
Morning dharahara
Another Song Playing In My Mind
TPS Renewal Reregistration
Nas and The Bokas: Coming to a Night Club near you
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