![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
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.
|
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4
![]() |
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! |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8
![]() |
I wrote a program similar to this in Python, using the GLOB library. If you like, I can post it.
|
|
|
|
|
|
#4 |
|
Programmer
|
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" ...
|
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#6 |
|
Programming Guru
![]() |
Check out the system(); function for executing command line commands from a C++ program.
__________________
|
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#8 |
|
Newbie
Join Date: Sep 2005
Posts: 2
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#9 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#10 |
|
Expert Programmer
|
Windows Mondad was released (beta perhaps?) it's a scripting enviroment for windows. It could be promissing.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|