ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I am wondering if there are script languages like bash/perl/php that comes with windows?
I know all 3 of the above languages can be used under windows, and they run natively but what I am looking for is something more "native" to windows in the sense that it comes with, or supported by Microsoft directly so that you don't have to install anything to program or to run the scripts.
Regarding the console world in windows, all I know is DOS, but I don't think it is a powerful tool.
Perl is available in a Windows Port: http://www.cpan.org/ports/#win32
ActivePerl I've used and like
Also, Java can be used to build console applications, if that helps any.
Hope this helps
Edit: Just re-read the post, and that probably doesn't help much...
The closest thing you are going to get without a third-party application is batch scripts... but these pale terribly in comparison to anything listed in your post...
I will check out about VBscript when I have the time.
Just for your information, The reason why I want it to be available on windows is that I want to write some utilities for my friends. I don't think it is a good idea to ask them to install perl/PHP/cygwin or whatever just to run those little scripts.
Hi, I am wondering if there are script languages like bash/perl/php that comes with windows?
I know all 3 of the above languages can be used under windows, and they run natively but what I am looking for is something more "native" to windows in the sense that it comes with, or supported by Microsoft directly so that you don't have to install anything to program or to run the scripts.
Regarding the console world in windows, all I know is DOS, but I don't think it is a powerful tool.
Any opinions are welcome.
Thanks.
VBScript is what you want to use. Along with WSH (Windows Scripting Host), you can pretty much accomplish most things you would use bash/perl/python to do, though I find you end up writing a bit more code in some cases. VBScript is more like a glue language, in that it doesn't really have many useful libraries build into it (in contrast to perl or python), but with the CreateObject() function, you have access to boatloads of the standard ActiveX objects that come preinstalled on most Windows machines.
It is not a very modular language, though, so it is best for short, administrative type scripts, in my optinion.
Because I can do this with Perl... and you cannot with a batch file without installing third-party command-line utilities...
Code:
sub fix_id3 {
# Here's where the magic is done
$album = $_[0];
$artist = $_[1];
$genre = $_[2];
$file = $_[3];
print "What is the track name? ";
chomp ( $title = <STDIN> );
# wrap the object constructor call in an eval to
# make sure we catch any weird errors and object was
# created ok
eval {
$mp3 = MP3::Tag->new($file); # Creates new object
};
# Make sure the object was created OK
if ($@) {
die qq{Error creating MP3 object, $@}; # if not, die and tell us why
}
unless ( exists $mp3->{ID3v1} ) { # assure ID3v1 is a valid option
$mp3 -> new_tag("ID3v1");
$mp3 -> {ID3v1}->write_tag; # otherwise, create it
}
$mp3 -> {ID3v1} -> title("$title"); # adds element title
$mp3 -> {ID3v1} -> artist("$artist"); # adds element artist
$mp3 -> {ID3v1} -> album("$album"); # adds element album
$mp3 -> {ID3v1} -> genre("$genre"); # adds element genre
$mp3 -> {ID3v1} -> write_tag(); # writes the tags
$mp3 -> close(); # close the file
# we'll also rename the files
$oldname = "$file";
$newname = "${artist} - ${title}.mp3";
rename $oldname, $newname;
print "\n";
}
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.