Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 20th, 2005, 10:21 PM   #1
davidguygc
Programmer
 
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0 davidguygc is on a distinguished road
Windows Scripting

I'm really sorry if this is the wrong forum, mainly because I have no idea what I'm looking for exactly. I want to learn how to create a program, doesn't need to be GUI, that finds preset directories, locations, and such and change them. Like if I could get something that in that folder, change the extension from .mpeg to .mpg if it isn't already. Basically doing all the tedious tasks rolled into a program.
davidguygc is offline   Reply With Quote
Old May 1st, 2005, 5:24 PM   #2
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4 mackenga is on a distinguished road
Well, I think it's not /strictly/ the right forum, but it's not miles out; it is a shell-scripting task you want to do. Trouble is, on Windows you're quite restricted as far as scripting goes.

I'm not 100% sure what it is you want to write, but I think you'll probably find you have to do more learning than you'd hope in order to write this sort of program.

Most DOS/Windows scripts (equivalent in role to shell scripts on Unix) are written as Batch files, but the language is perverse and you really get sick of it very quickly. I recommend getting Tcl/Tk installed - it's free. You can download it at http://tcl.activestate.com/ - they'll try to sell you the 'professional' version but it's not like the free version is restricted or anything.

Then get a book - I like "Practical Programming in Tcl and Tk" by Brent Welch - see http://www.beedub.com/book/ - which really does cover everything. The nice thing about Tcl/Tk is that it's very high-level and easy to get into, but still a very rapid way to write GUI programs if you want to.

Oh, and I almost forgot to mention: the best thing about Tcl/Tk is that it's available for Unix, Windows and MacOS, and a script written on one platform (if you take a bit of care not to do unportable things) can usually run unmodified on any of the others.

Hope this helps!
mackenga is offline   Reply With Quote
Old May 2nd, 2005, 5:54 AM   #3
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8 Ooble is on a distinguished road
I wrote a program similar to this in Python, using the GLOB library. If you like, I can post it.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 18th, 2005, 7:47 AM   #4
hemanth.balaji
Programmer
 
Join Date: May 2005
Posts: 54
Rep Power: 0 hemanth.balaji is an unknown quantity at this point
Send a message via Yahoo to hemanth.balaji Send a message via Skype™ to hemanth.balaji
I have created a win32 Application using Visual c++. Does anyone know how to execute a command line program from within a windows program. I have a DICOM Image file and I want to convert it to a bmp file by running a command line option provided by InfraView, by the click of the mouse button. How do i run a command like "i_view32.exe c:\test.bmp /convert=c:\test.jpg" ...
hemanth.balaji is offline   Reply With Quote
Old Jun 9th, 2005, 2:03 PM   #5
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
check out cygwin if you want to write UNIX shell scripts on a windows box.
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2
skuinders is offline   Reply With Quote
Old Jun 9th, 2005, 4:23 PM   #6
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Check out the system(); function for executing command line commands from a C++ program.
__________________

tempest is offline   Reply With Quote
Old Aug 31st, 2005, 6:57 AM   #7
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4 mackenga is on a distinguished road
Just a quick mea culpa; I've learned a little more about Windows scripting lately, and you can actually do this kind of thing with a script in VBScript or JScript run through the Windows Scripting Host (WSH). You need to create a "Scripting.FileSystemObject";

var fs = new ActiveXObject("Scripting.FileSystemObject");

Then you can use fs to read and write the filesystem in various ways. There's more information available online; quite a bit at Microsoft's site in fact. Google for "JScript Administration" or something similar and you'll get useful results.
mackenga is offline   Reply With Quote
Old Sep 26th, 2005, 3:26 PM   #8
Diamond_Don
Newbie
 
Diamond_Don's Avatar
 
Join Date: Sep 2005
Posts: 2
Rep Power: 0 Diamond_Don is on a distinguished road
mention: the best thing about Tcl/Tk is that it's available for Unix, Windows and MacOS, and a script written on one platform (if you take a bit of care not to do unportable things) can usually run unmodified on any of the others.function for executing command line commands from a

For example...

do i run a command like "i_view32.exe c:\test.bmp /convert=c:\test.jpg" ...Then you can use fs to read and write the filesystem in various ways.-Don
Diamond_Don is offline   Reply With Quote
Old Feb 21st, 2006, 3:27 PM   #9
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4 mackenga is on a distinguished road
Since posting this I learned a little more; you don't need to use "new ActiveXObject" really; this is neater:

var fs = WScript.createObject("Scripting.FileSystemObject");

I think the other method is just a little old-fashioned; it does work but I prefer this method.
mackenga is offline   Reply With Quote
Old Feb 21st, 2006, 4:33 PM   #10
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 707
Rep Power: 4 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
Windows Mondad was released (beta perhaps?) it's a scripting enviroment for windows. It could be promissing.
thechristelegacy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:52 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC