Monday, December 28, 2009

Oldskool Demomaker (OSDM) Is No Real Code and Lame

I got such comments several times already. Some folks make a real fuzz about it and take it rather serious. I understand where the haters of OSDM (Oldskool Demomaker) are coming from and thought that I should make some comments about this issue. I have a section on my web site dedicated to OSDM and my own intro productions created with it, if you want to learn more about what I am going to talk about.

Coder700x100[1]

First, I am not a “CODER” myself and never really was, at least not in the Scene. There I was a graphician and also designer, next to being a group leader and organizer and sysop of a bulletin board system, short BBS. I did program tools, such as PPE’s for the BBS software PCBoard, but never intros, cracktros or demos.

OSDMLogoRoy2[1] Close Look at OSDM

I believe that many of the nay Sayers' never really looked at OSDM up close and personal.

OSDM has many limitations and restrictions that could be compared to the limitation that programmers of old DOS PC faced and had to work with and around. You have to cheat a bit here and there to get effects the way you want to, just like back then. OSDM has its own scripting language too by the way, so it is not only point and click. Or let me rephrase it. Yes, you can get results with the tool quickly and with relative easy, but the result looks like quick and dirty as a consequence of that also. Nothing to be proud of, I agree with that totally.

Hard Core Coding Is Dead (Almost)

On modern day PCs, no oldskool hard core coding is really much done anymore nor is it necessary. The computers are so powerful and the OS already comes with so many ready to use APIs for graphical effects, like vectors, texture mappings, lighting effects etc that it does not require any hard core code to create fancy 3D worlds and flashy effects. Most demos today that win the demo compos at demo parties are winning because of their unique designs and not because of their “code”. Coming up with a new mash-up of effects that is new is more important than to crank out highly optimized Assembler code.

The exception today is probably only the 64KB and even more the 4KB intro competitions, because the limit in size for the entire production requires highly optimized code. The standard API stuff and Vector definitions, textures and music would take up too much space to get results that could make you win in a competition.

OSDM Productions Don’t Compete

OSDM is not about competition and showing off coding skills, so it is okay, if the code is not optimized and bloated, because it still works fine and renders the desired results fluent on today’s computers. Creating and watching an Intro with OSDM is actually more like an interactive trip back on memory lane to embrace good old days of the past, “oldskool” stuff.

This is also one reason, why I am using mostly “classic” and well recognized tunes for the music of my OSDM intros, to reinforce the notion of “oldskool” and past glory. Not that there is no other music that I could use instead. There are plenty of old tracks by my buddy’s from SAC that were never used for an Intro or Demo as they were intended while just ending up as another tune in one of our SAC Artpack releases instead. So it was and is a conscious choice of mine. I hope to bring back memories… good ones I hope.

I also add a new touch and personal flavor to it. My own stuff. Some stuff I only do to show off what I can do with OSDM to impress my buddies from the OSDM fan community who might start wondering how I did this or that with OSDM. OSDM is not written in perfect code and you can get very unexpected results when you turn on all the knobs and switches when you are creating effects combinations. Some of it is hard to impossible to predict and makes things IMO also more interesting. It’s not a coder contest!

Creating Real Cracktros With OSDM

Some of the intros I created with the intention to be used as real release cracktros and I ask the question: “Why Not?”. Sure, I could have it coded or probably even could code it myself. No big deal. As I said earlier, I don’t have to produce hard core code to get the desired results. Generic routines, libraries and code will do just fine. What is the difference really to what you do with OSDM? It is also just a graphical interface around an effects library that was written by another dude for Pure Basic, plus some supporting tools.

You don’t even have to use the interface really. You could just do everything in the preferences file, which is an .INI text file to define what you like and then only use OSDM to compile the final executable. It’s just like a wrapper; a wrapper that helps folks who do not consider themselves to be a “coder”, like me. I remember when I created designs for intros that were never coded, because of the lazy or incapable programmer, sometimes even an animation with a 2D animator program like Autodesk Animator Pro or Deluxe Paint Animation to illustrate what I want it to look like. Now I can do it myself. I am “Geek” enough to figure out how OSDM works, which is not so easy really, because its interface defies all standards of “usability” and “user friendliness”.

Times Changed, Things Changed

I sure understand where the negative attitude (mostly from coders) towards OSDM comes from. I was the same years back. I remember the Humble Guys Intro Maker 2.0 for example. It bothered me too back then in what was it 1992 or 1993? Yeah, I created an Intro with it once, a Fake one, for a lame release under a fake group, which was real, but too lame to release under the name of any of the groups I was running or a member of.

Times changed though and the reasons behind tools like OSDM also.

See For Yourself

Have a look at my Megatro 2009 Intros Pack (11 MB ZIP), which includes 28 Intros that I created with OSDM. You must admit that they are not too bad, if you try to forget about coding for the moment. Oh, the menu system for the release was programmed by myself in Pure Basic by the way. Nothing fancy, but the generic code I mentioned before. It was an afternoons worth of time to do it from scratch and my first program ever in that programming language.. go figure. OSDM has a feature to produce “Megademos” like my Megapack, but I did not use it, because of some shortcomings that were impossible for me to work around and at the same time unacceptable to use as is for my release.

I’d like to hear other folks point of view, arguments, opinions and comments. You can do so also anonymously, if you don’t want to reveal your name or scene handle in the comments section below.

Cheers!

Carsten aka Roy/SAC

Roy OSDM Megatro Intros Pack 2009 Release

I created a bunch of Intros via the OSDM – Oldskool Demomaker by Peace of Testaware, which is based on the FX Lib for Pure Basic by Epyx. You can enjoy and even download every individual production that I did in my OSDM section of the site, but that can get very tedious. 

So I decided to release a pack with most of my intros that I created in the year 2009, where you get them all at once in a single package. I wanted to use the “Megademo” tool that comes with OSDM by default, which works, but had some short-comings that I was not happy with. All intros were executed in the same resolution in Full Screen and in the order that I specified. You cannot jump to a specific one, worse, you have to jump through all of them first in order to be able to exit the collection. With 28 intros in my collection, that was not an option.

My First Pure Basic Program

So I programmed something myself, using Pure Basic. Details and links to download my Megatro 2009 here.

It is nothing fancy, but it shows a logo, plays some tracker music by DAC/SAC in the background and lets you select, which intro you would like to watch via cursor keys in an interactive menu. I also included a NFO viewer for my release NFO file, which I plan to extend on.

The Menu stays active when you select an Intro to run, but the menu music is stopped. Once you exit an intro via pressing the ESC key, you are taken back to my menu where you left off. Press ESC once more or select “Quit” via your cursor keys and it exists the menu as well.

It was my very first program written in Pure Basic so please forgive me, if it has any bugs and may not work properly on every Windows computer.

Screen Shot of the Megatro 2009 Menu

Roy-Megatro2009-menuscr

As an extra bonus I created a special intro just for this release, which I hope you will like too. Here is the video capture of this special intro.

Not Included

Not included are two versions of the first ROoRS cracktro that I created in Spring 2009. I have video captures of those and also executables to download, but the problem is that those intros, compiled with an older version of OSDM cannot be exited via ESC key or any other key or mouse click at all. It must be terminated via Task Manager what sucks. I also cannot recompile the intros with the current version of OSDM anymore, because they are using the Vector Direct effect, which does not work for me under Windows Vista nor Windows 7 64bit. Also missing is one older version of my first Roy/SAC intro. There I have the same problem as with the ROoRS intros.

I thought that I won’t make any more intros this year, but I was wrong. I created already 2 more intros this year, which were finished after I released my Megatro 2009 pack. One intro is the RoySAC.com Intro called “Starfall” and the other is the TOaO – The One and Only Cracktro Version 2.

OSDM Section Revamp and OSDM Resources

I also revamped the OSDM Section of my site where I showcase all my creations. It used to be one page only, which grew and grew and probably started to cause some problems to load for some due to the massive amount of embed video players on a single page. The section now has a homepage with general information and individual sub-pages for each production. Jumping from one production to the next is easy via the menu navigation tree, which is on every page hidden by default (except for the homepage)  and made visible via a click on a button when needed.

I also added a resources section that is useful for anybody who already uses the Oldskool Demomaker himself or plans on using it. You can find there links to collections of fonts, logos, music and more, which are great raw material for your very own OSDM production.

Enjoy the Show and Have a happy new Year

Cheers!

Carsten aka Roy/SAC

Friday, December 25, 2009

GET LAMP – Text Adventure Documentary DVD by Jason Scott

Uh, my second post today. Well, I am German and we celebrate Christmas on the 24th (Christmas Eve). On Christmas day we usually only have a family lunch, which is kind of difficult for me to attend today, since I am living several thousand miles away from Germany and my parent now, in the much warmer California hehe. So I don’t have anything better to do than to write some overdue blog posts hehe.

JasonScott-7bit-ascii-color-ccu A quickie, for all the fans of Jason Scott and his non-mainstream projects that usually involve computer history.

He finished his latest project, which is a documentary DVD (2 Discs) about Text Adventure games, you know, Zork and those kind of games, the kind of games Infocom is famous for. The documentary is called “Get Lamp” and I am not sure what it means exactly. I know that it could be a command from a text adventure game, but I don’t know if it is from one in particular. I hope the documentary itself will shed some light on it.

The 2-discs DVD will go on sale in March for $40, but for the fans, who pre-order the DVD before the end of the year, it’s only $30, a 25% discount. Details can be found at his blog here. If you missed the opportunity to snatch up the DVD for the discount, I recommend to get over this missed opportunity now and go buy it anyway. You don’t have to buy the latest blockbuster movie DVD instead. You can download those via torrents. Rather spend your money on something where it is put to good use. In this case you can be sure that the person who deserves the money will also get it. hehe. (No, I am not getting paid by Jason for saying that)

For those who don’t know what text adventures are. Imagine an interactive book that tells you everything that is happening and where you enter commands and instructions in English and the story will change based on your commands and actions. No mouse, no fancy 3D graphics, not even the EGA blocky 16 colors low-res graphics from the first titles of the Sierra adventure series titles like Kings Quest, Space Quest, Police Quest etc.

Here is a short teaser video for the DVD.

If you don’t know who Jason Scott Sadofsky is, you might heard about his other projects. He runs the archive web site Textfiles.com, which has various sub-branches like artscene.textfiles.com, cd.textfiles.com and many more, where you can find historic PC text files, images, zip-archives etc. from the era of the bulletin board systems and beyond. He also create the 3 discs documentary DVD “BBS – The Documentary”, which he released under “Creative Commons” license to make it more accessible and don’t have users to deal with all the legal copyright and copy-protection bullsh*t. If you like it, you will probably buy it, like I did, twice hehe.

Well, I bought my second copy to get it signed by Jason at DefCon 15 in Las Vegas in 2007 where he was a speaker also. He also speaks at other conferences like Notacon and his sessions about various different and not related to each other subjects are interesting as well. Even if the subject might not be of your interest, its also entertaining just to watch him doing his “thing” hehe.

He also has a blog where he rambles about god and the world and if you are a Halo 3 fan, you can watch some of his game session video captures on YouTube.

If you don’t like Text-adventures, Bulletin Board Systems, ASCII art, Halo 3 or computers altogether, but use the internet because you have to, check out his Twitter account “Sockington”. Actually it’s not Jason’s Twitter account, but the account of his cat with the name Sockington :).

Interesting mix, right? So now you got an idea of what to expect from the “Get Lamp” documentary DVD. I have to admit that I never played text adventures myself. I like adventure games though and the first ones I got to know and play where the early Sierra On-Line and Lucasfilm Games adventures (yeah, you heard right, Lucasfilm Games, that is what his game development company was called at first, before they renamed it to Lucasarts). However, I know the other things that Jason did and does and no matter the topic, it’s always interesting and entertaining at the same time. That alone is worth every penny to me.

Cheers!

Carsten aka Roy/SAC

Batch MS DOS ASCII to Web Converter Script

A little script that converts MS DOS ASCII files, such as NFO's  or FILE_ID.DIZ text files (Code Page 437, USA) to Unicode  and HTML encoded files that can be used to display the ASCII art, specifically the "High ASCII" or block ASCII art on a web site. The script is written in VBScript, but the release package also includes a Windows executable, which is the VBScript converted via VBSEdit by Adersoft.

I used the same script to prepare the ASCIIs in my text art galleries on my web site, such as:

just to name a few.

NOTE: An Updated Version of the Script is also available now!

You can download the script here:   ROY-BATCHCONVERT-ASCII2WEB.ZIP (555 KB)

For example the top logo of this NFO file, which is in DOS ASCII Format and looks like this:


───────── ▄ ▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄ ▄ ▄▄▄ ▄▄▄▄▄ ▄ ─────────
·R·E·L·.· ▄ ▄▄▄▄ ▀▀▀▀▀▀███ ▀▀▀▀▀▀▀▀███ █ ███ ▀ ███ ▄▄▄▄ ▄ ·2·0·0·9·
─────────── ▄ ▄▄▄ ███ ▄▄██▀ █ ███ █ ███ █▄ ▀▀▀▀▀███ ▄▄▄ ▄ ───────────
▄▄ ███ ▄ ███ █ ███▄▄▄▄▄▄▄▄ ▄▄▄▄▄███ ▄▄
▀▀▀ ███ ▀ ▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀


would be converted to the following;

───────── ▄ ▄▄▄▄ ▄▄▄▄▄▄▄▄▄   ▄▄▄▄▄▄▄▄▄  ▄ ▄▄▄ ▄ ▄▄▄ ▄▄▄▄▄ ▄ ─────────
·R·E·L·.·  ▄ ▄▄▄▄ ▀▀▀▀▀▀███ ▀▀▀▀▀▀▀▀███ █ ███ ▀ ███ ▄▄▄▄ ▄  ·2·0·0·9·
─────────── ▄ ▄▄▄ ███ ▄▄██▀ █ ███ █ ███ █▄ ▀▀▀▀▀███ ▄▄▄ ▄ ───────────
               ▄▄ ███ ▄ ███ █ ███▄▄▄▄▄▄▄▄  ▄▄▄▄▄███ ▄▄
                  ▀▀▀   ███ ▀  ▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀

Note: I included the release ZIP archive are the files roy.asc and roy.web as examples also.

It would look just like the ASCII above the blue code, if you use it properly in your HTML page.

The Web encoded ASCII does not include <BR> Tags for the line-breaks. You have to add those manually or do what I do on my web site and enclose the code in <PRE> </PRE> tags, which preserves the line-breaks within the enclosed text.

Since the result is Unicode and not DOS ASCII anymore, you can use any mono-space font to display the ASCII somewhat correctly. You won't get a 100% accurate result anyway, because the old MS DOS font set is not part of Windows anymore. What you can get is only a close approximation. I use on my web site the font "Lucida Console", which seems to be installed on many machines. If the Windows of the user who visits your page with the ASCII for example does not have that font installed, Windows will automatically pick another font that comes close. I use the following CSS formatting for the PRE tags where I show ASCIIs. 

 


   1: pre {
   2:    background-color:#000;
   3:    color:#FFF;
   4:    display:block;
   5:    font-family:"Lucida Console", monospace;
   6:    font-size:9pt;
   7:    line-height:12px;
   8:    padding:10px;
   9:    text-align:left;
  10:  } 

If the PRE Tag is also used for something else on your web site then you can also define it for a specific class selector like


   1: pre.asciiart {
   2: ...
   3: } 

You would then also have to extend the PRE HTML tag like this:


   1: <PRE class=asciiart>
   2: ...
   3: </PRE> 

The script is designed to convert all files with a specified extension (.ASC by default) to web ready files with a new extension (.WEB by default, but you could also make it .HTML or whatever).

There are two additional options, where I recommend to use the defaults (which is "yes").

The first one is "Sanitize?"


What that does, is removing ASCII characters with an ASCII code smaller than 32, which are special control characters that cannot be printed anyway, with 3 exceptions, chr(10) = line-feed, chr(13) = carriage-return and chr(9) = tab. LF and CR remain unchanged. Tab characters will be converted to 8 spaces, which is the default MS DOS tab-stop.


The second option is "HTML Encode?", which means that all non-US-ASCII characters (the 7 bit ASCII codes) will be converted to HTML codes like &#XXX;. Also standard ASCII characters that could be misinterpreted by HTML or DHTML and XML are also encoded, like the " becomes &quot;, & becomes &amp;, < becomes &lt; and > becomes &gt; etc.


Part of this package is the image "Batch-ASCII-2-Web-Steps.jpg", which shows screenshots of all the steps where the script goes through.

You can download the script here:   ROY-BATCHCONVERT-ASCII2WEB.ZIP (555 KB)

Batch-ASCII-2-Web-Steps

You can download the script here:   ROY-BATCHCONVERT-ASCII2WEB.ZIP (555 KB)

Enjoy!
Carsten aka Roy/SAC

PS. This script is freeware. Do with it whatever you like, except selling it. You can use it free, copy it, share it, even modify it if you like to. You are using it at your own risk. You cannot make me liable for any damage or loss of data that might results directly or indirectly because of the use of my script.

Batch-ASCII-2-Web-BeforeAfter

Monday, December 14, 2009

Malware Threat Warning! Scam via Online Video!

This is not a prank! I Just stumbled across this when videos by the YouTube user  Kaleigh421112Trang suddenly showed up in my subscriptions (based on Keywords) for my CirqueDuSoleilGuru account.

I made the URLs that are not hyperlinked this way on purpose, to prevent any accidental harm to the readers. You can copy and paste the URLs into your browsers address bar, if you know what you are doing at your own risk. Don’t say that I did not warn you!

The user account in question was just created on 12/13/2009

By now this user has already 190 virtually identical videos uploaded that don't show much, except a message that the video cannot be watched on YouTube due to length limitation. See description for link to full video. etc. Here is a screen shot of it.

YouTubeScam01

E.g. Circus Circus Part 1/13 Online*:  http://www.youtube.com/watch?v=l5kYgqUX0rE

*This video was actually already taken down by YouTube, maybe because I flagged it as Spam from an established YouTube account with almost 2000 subscribers. But most of the other videos are still up as I am writing this. For example this one http://www.youtube.com/watch?v=hJj-PkdLqac  (which I also reported so it is probably being removed shortly as well)

YouTubeScam05

The videos that are still up all include a short description and a obscured link with tracking code embed via the redirection service TinyURL.com. In the example video that I mentioned before and reported to YouTube already the URL was: http://tinyurl.com/ycksuwy&499420166

Here Comes The Scammy Part

That URL redirects to: http://www.onlinemoviedb.info/watch.php?vid=Dreaming_in_Circus

The page states that a plug-in must be downloaded to watch the video. It includes multiple links where you are supposed to download the needed plug-in from, such as this one (Warning! Do not Download and Execute)!

http://preview.licenseacquisition.org/48/1056428137.51143/vlc-1.0.1-win32.exe

The referred to EXE “vlcsetup.exe” is 328,984 bytes in size. The file name is implying that the plug-in is related to the freeware VideoLan Video Player, what it is not.

YouTubeScam02

I downloaded the executable without starting it. I then scanned it with McAfee Viruscan, which did not detect anything yet. So I uploaded it to VirusTotal.com, an online on-demand virus and malware scanner, which scans files using over 50 different scanners such as McAfee, F-Secure, Bitdefender, Kaspersky, Panda, PC-Tools, Sophos, TrendMicro and others.

I wasn’t the first one who checked the file obviously, because a report was already available*, which gives it a 37% probability that it is infected. It is probably new and I bet the probability will increase as I write this (as do the uploads of virtually identical videos with the same purpose to YouTube).

Here is the link to the report from VirusTotal.com.

 

* VirusTotal.com knows that it is the same file as somebody else already submit based on the file size and file name, because that could be faked easily. It uses so called checksums that are generated from the entire content of the file. The Checksums for this file are for example:

MD5   : bead2d46d08ff080ac4a6d0908922230
SHA1  : 0697fe4257419efc39921c9da71c8339cde3f463
SHA256: 6e62e219e38c90562a59851b72f2929000b599a6ddd0f2482c7b1acda0a8ce9d

More Hints and Scale of the Problem

YouTubeScam04Here are more accounts on YouTube. Just to name a few (Each with hundreds of videos each):

http://www.youtube.com/user/Moon230377Arletta
http://www.youtube.com/user/Dirk891479Pasty
http://www.youtube.com/user/Kathy664276Dominica

There are most certainly a lot more, but they should be easily be detected. Look for new users that have hundred+ videos of 9:58 minutes length and a TinyURL.com link in the video description.

All of those Users always have video listing disabled (does not show anything on the user’s home page)

The target website itself lists tons of copyrighted movies on its homepage.

Also suspicious, the detail page of every movie has the same comments to give the impression that people watched the movie etc. 

Here are the fake comments

Looploop
3rd link worked perfectly and fast mirror. I liked it. Thanks for the upload! 

Hotjamz
Yep that was a good one 5/5 

Monstersb
didn't think it was all that,but it was good.7/10.great qualit tho 

DazedNConfused
How do I watch this video? 

DazedNConfused
Never mind. I just downloaded the plugin and the video worked flawlessly! 

This Is Just The Beginning

The uploads are done on a large scale and with sophisticated scripts to dynamically create typical titles with matching descriptions in YouTube. YouTube also has a dupe checker that identical videos cannot be uploaded by the same account (at least used to be it that way). But changing a single byte is already enough to get around it. That’s probably all these guys did, because the videos appear to the human viewer identical. They also show all the same Thumbnail, which should raise suspicion by any user of YouTube with some working brain cells left (That is how I got suspicious). The hackers are obviously not sophisticated enough though, because they did not seem to have taken into account the problem with identical thumbnails that will appear in the box with “more videos by …” but also in the “related video box” where I got the other user names from. Because the videos are similar in some fashion, YouTube thinks that they are related.

It is very very hard to produce identical thumbnails for videos that are not identical. In the early days YouTube used frames that could be predicted in advance (and was used for manipulations by users). This isn’t possible today anymore.

I would not be surprised, if similar scams will pop-up in the future more and more, also on other smaller social networks and video sharing sites. Those scams will also get more and more sophisticated and users will be vulnerable until their Antivirus/Antispyware software will be updated to detect those new threats that will emerge and then disappear again quickly.

The only real protection is up to the user himself

NEVER download and install a plug-in where you don’t know and trust the source. Installing a malicious plug-in is like unlocking the door, disabling the alarm and then open it to invite the burglar in to have a look around and take whatever he likes.  Almost all video sharing sites use FLASH for the video playback. The Flash plug-in should only be downloaded from the Adobe.com web site (and not from anywhere else).

http://www.adobe.com/go/getflashplayer

Some apps might use the Shockwave plug-in, also from Adobe, which can be downloaded and installed via

http://www.adobe.com/go/getshockwave

Although I have not seen used with online video yet, web applications might also use JAVA by SUN, which can also be downloaded absolutely free of charge (like the FLASH and SHOCKWAVE plug-ins) from the web site that was created by SUN just for this. The URL is: http://www.java.com/download

Be Careful, without getting paranoid. Use common sense and caution where appropriate. Unfortunately not everybody on the Internet has the safety and happiness of the users in mind.

Be Safe!

Cheers!

Carsten aka Roy/SAC

Tuesday, December 01, 2009

Extortion and Trickery Practices of American Banks Exposed

Note: I only write about social and political issues at my personal blog, if I think that I must. This article qualifies as such. It also seems to be an issue that only applies to Americans and not other western or developed countries as far as I know. Correct me on that one, if I should be wrong about this assumption.

I recently watched the 56 minutes long episode “The Card Game” of the PBS documentary series “FRONTLINE”, which premiered on American television on 11/24/2009, investigates the massive US consumer loan and credit card industry and its abusive behaviors in the past and present in an unregulated marketplace where anything goes. The video recording of this documentary can be watched online at the PBS.ORG web site.

I was aware of many of the aspects of the American loan industry and surprised that such predatorily behavior that was demonstrated by all US Banks and other private enterprises was perfectly legal in this country. I was initially shocked when I learned about those realities and still disgusted by it and by anybody who argues that this is okay and perfectly normal in a free and market driven economy, especially if those individuals claim that the those cases which might be considered excessive are only exceptions and not created intentionally for profiteering by those companies and banks that cause them. banking-abuse

Some of the facts from the documentary were even new to me and disgusted me only more and at the same time aware of the fact that there is a pressing need for change, especially in times like these. I highly recommend watching this video. I decided to write this post to extend on that and also raise the awareness that most other free countries in the world already did something about the problem hundreds of years ago.

Some people describe the industry as the “Wild West”, but the Wild West was never that wild in comparison. The only thing I can think of to compare it to is defined as “organized crime” and generally known as criminal acts committed by a “Mafia”. Many members of the Mafia served and serve prison sentences for crimes that dwarf the, for the average JOE indistinguishable from each other, but perfectly legal practices (under U.S. laws) committed by the banks. There is no doubt that those practices are considered “immoral” and worse by the vast majority of people in the United States and are outright illegal in most other western countries, including Great Britain and my own native country of Germany.

These practices have a specific word to describe them in the German language, called “Wucher”. I did not know if there existed a word in the English language for this as well and only learned about it recently also. The word “Usury” seems to be that word. The Britannica Concise Encyclopedia defines “usury” as:

Usury

In law, the crime of charging an unlawfully high rate of interest.
In Old English law, the taking of any compensation whatsoever was termed usury. With the expansion of trade in the 13th century, the demand for credit increased, necessitating a modification in the definition of the term. In 1545 England fixed a legal maximum interest, a practice later followed by other Western nations (with the exception of the United States*).

*added by author

The Concise Oxford English Dictionary defines usury as:

English: usury = lending money at exorbitant interest rates. archaic interest at such rates.

Those definitions are in my opinion too short and also too narrow to capture the full meaning of the German word “Wucher”. So I will try my best for my own definition to describe it to you.

Usury describes the offering of a service and demanding in return for a clearly excessive compensation, exploiting a situation when the party this service is being offered to is the most vulnerable and typically left without another choice with the exception of extreme and typically immediate destructive ones. It could also be an offer where the actual compensation the party that became victim of usury agreed to was well hidden in the agreement itself. The victim would have been unaware of it during the time when the agreement was made, not consent with the fulfillment of its obligation when it becomes apparent, and never had knowingly agreed to those terms when the contact was sealed.

Usury is a legal exception to a free economy that is in general market driven without government interference for an exceptional situation that is clearly located outside of the typical free market environment. Usury could be described as the financial world equivalent of extortion, fraudulent deception or trickery committed in the real world.

Contractual agreements imposed by one party on another that could be described as Usury are also often the attempt by one party to “lock in” the other one in a vicious and destructive cycle to extort the maximum amount of profit from the party that fell victim of a usury (typically exceeding the value of the original services that was provided by the first party many times over) and in many cases leading to a point where the victim becomes unable to fulfill the obligations demanded by the agreement.

The setting of a maximum interest rate for a loan transaction is one method to prevent usury, but not the only or even best option, because it would not protect against usury committed outside of loan transactions, but the same premise and outcome.

German business law as it is defined within paragraph 2 of § 138 (article 138) with the BGB “Bürgerliches Gesetzbuch” (German Civil Code) describes “usury” as follows:

durch das jemand unter Ausbeutung der Zwangslage, der Unerfahrenheit, des Mangels an Urteilsvermögen oder der erheblichen Willensschwäche eines anderen sich oder einem Dritten für eine Leistung Vermögensvorteile versprechen oder gewähren lässt, die in einem auffälligen Missverhältnis zu der Leistung stehen.

Quote taken from the German Language Wikipedia entry for “Wucher

It roughly translates to English (which wasn’t easy to do):

“that someone through the exploitation of the position of constraint, the inexperience, the lack of judgment or the considerable lack of will-power of somebody, takes advantage for one selves  or a third  party  intending or not preventing to gain material advantages for a  reward or  financial promises that are strikingly disproportionate to the value of the provided service .”

Mutual agreements or contracts that qualify as usury are automatically void and never considered valid or binding from the start, even if they were signed by both parties. Since the definition does not include any specific figure or exact definition of what is “disproportionate” in return for any given service, courts normally have to decide that on a case by case basis, evaluating all objective and subjective arguments from both sides, but the general “rule of thumb” is that in virtually any case a usury is committed, if the required compensation for a service is in excess of twice the value of the original service provided by the usurer.

A $30 “overdraft fee” that is charged for a transaction that exceeds a person’s account balance by $15 or less and covered by the “overdraft protection service” provided by the bank is a clear case of usury. As stated already, it is irrelevant if the person agreed to the terms of this service or not. Making the customer aware of the fee alone is not enough, because the customer is typically unaware of all the facts required to be able to predict the invocation of the service due to the lack of transparency of the underlying transactions that trigger it. Unexpected freezing of funds for some reason, delayed processing of transactions unfavorable to the customer or expedited processing of transactions favorable to the bank, non-chronological booking order are often the cause for the unintended activation of service by the customer thus preventing the customer from avoiding it in the first place.

Usurers could even face civil and criminal charges in Germany, risking imprisonment, depending on the amount of damage that was caused to the other party as a direct or indirect consequence from the usury.

By German law, ALL CEO’s of US Banks would most likely have to spend long prison terms for all the damage caused to people as a direct consequence of the usuries committed by their banks. The practice of so called “payday loans” (short term cash advances offered for a high fee) is beyond doubt usury and thus illegal in Germany by definition already, even though the fees are much lower than twice the amount loaned when only looked at the nominal values of those transactions. However, the transaction is for the average person indistinguishable from a “loan transaction” as defined by US laws, even though it does not qualify as such in the US legal system. The standard terms for the calculation of due return payments of loans are defined by the annual interest rate applied to the loaned amount. In the case of payday loans, this annual interest rate is typically over 400%, which is far beyond 200% of the “thumb rule”.

The PBS documentary shows that recent legislation made by the Obama administration was incapable to really address the issue, changing virtually nothing and certainly not the behavior, not to mention the attitude, of the American banks to protect the free economy from such predatory behavior.

If you ask a criminal who was sent to jail for committing crimes like extortion or trickery, they will most certainly claim their innocence, trying to convince you that their victim had either a choice (in the case of extortion) or they should not have been blamed for the lack of comprehension, knowledge or intelligence in the case of the victims of their trickery and deceptions. Compare this to arguments made by PR (Public Relations) agents and lobbyists for the banking industry and you might find them to be striking similar to each other with only one major difference. In the first case they come out of the mouth of a convicted criminal wearing a “striped” prison uniform and in the other out of the mouth of a well groomed person wearing business attire.

A law that protects honest people and businesses from usury is just as bad in a free market economy (or necessary) as criminal laws that protect the same honest people and businesses against extortion and trickery, and what is wrong about those? Are they limiting your personal liberties and freedom? The criminal who was sent to prison because of them probably would agree, but do you?

Cheers!

Carsten Cumbrowski

Feel free to comment or express your own opinion about this subject via the comments section below. You can do this anonymously, if you don’t want to state your name. I will publish any comment unless it is nothing more than a personal attack of any other person (including myself)  without any factual proof to backup any defamation attempts, off topic spam or stuff that is illegal and could create any legal issues.

Saturday, November 28, 2009

File Processing Scripts Collection V1.0

Here is a collection of useful DOS BATCH and VBSCRIPT scripts for processing, moving, sorting of files.

The code for all scripts can be downloaded in a single ZIP file called: Roy-FileProcScripts.zip

The ZIP archive also contains a nice intro for RoySAC.com, which I recommend to check out :).

ImageFilesSort2Dirs.bat

IMAGES Cleanup/Sorting Batch Script

  1. looks for IMAGE files in current directory  (Extensions JPG, PNG, GIF, BMP, LBM, TGA, PCX, SVG, TIF, IFF)
  2. looks for "-" in file name (assumed to be  the separator between Artist Name and Image Title)
  3. parses string before first "-", trims trailing spaces
  4. checks if directory with that name exists
        4.1 If not, it creates it (artist name)
  5. moves all image files of the artist into the artist dir
   1: @echo off
   2: :: -------------------------------------------------------
   3: :: IMAGES Cleanup/Sorting Batch Script
   4: :: ------------------------------------------------------- 
   5: :: 1. looks for IMAGE files in current directory
   6: :: (Extensions JPG, PNG, GIF, BMP, LBM, TGA, PCX, SVG, TIF, IFF)
   7: :: 2. looks for "-" in file name (assumed to be 
   8: ::    the separator between Artist Name and Image Title)
   9: :: 3. parses string before first "-", trims trailing spaces
  10: :: 4. checks if directory with that name exists
  11: ::   4.1 If not, it creates it (artist name)
  12: :: 5. moves all image files of the artist into the artist dir
  13: :: 
  14: :: Batch Script by Carsten Cumbrowski aka Roy/SAC
  15: :: visit http://www.roysac.com
  16:  
  17:  
  18: setlocal enabledelayedexpansion
  19: CLS
  20: SET DC=DIR /A-D /ON /B
  21: SET EXT=JPG PNG GIF BMP LBM TGA PCX SVG TIF IFF
  22:  
  23: for %%f in (%EXT%) DO SET "DS=!DS!^^&%DC% *.%%f 2^^>NUL"
  24: SET "DS=%DS:~2%"
  25:  
  26: ::only list files with IMAGE extension, exclude directories
  27: for /f "tokens=*" %%A in ('%DS%') do (
  28:  if NOT "%%A"=="File Not Found" (
  29:    call :PERFACTION "%%~A%"
  30:  )
  31: )
  32: echo.
  33: echo Done!
  34: echo.
  35: pause
  36: goto :EOF
  37:  
  38:  
  39: :PERFACTION
  40: ::look for dash in file name, parse str before dash
  41: for /F "tokens=1 delims=-" %%B in ("%~1") do (
  42: ::trim trailing spaces from parsed string  
  43:     set str=%%~B%
  44:     for /l %%a in (1,1,31) do if "!str:~-1!"==" " set str=!str:~0,-1!
  45: )
  46: call :PROCFILE "%str%"
  47: goto :EOF
  48:  
  49:  
  50: :PROCFILE
  51: ::check if directory exists and move file(s)
  52: set f2="%~1"
  53: if {%~x1}=={} (
  54:    echo %f2%
  55:    if NOT exist %f2%  MD %f2%
  56:    FOR %%f in (%EXT%) DO MOVE "%~1*-*.%%f" %f2% 2>NUL
  57: )
  58: goto :EOF
  59:  
  60:  

MoveDirsToAlphaSub.bat


MOVE Subfolders and their content (including their subdirectories) to Destination Folder by First Letter of the Subfolder Name. I created this batch script to be able to sort content that I had in sub directories sorted by group names to an additional sub directory level by letter. I only needed the script to move the files in the sub directory itself, not worrying about additional sub directories that the folder might contains, but I extended the script to move those over as well. Here is an illustration of what the script does, using the example of mod tracker files in sub directories by group name.

Source:
   Ackerlight 
        Ackerlight1.mod
    Backlash
         Backlash1.mod

The script moves everything to a target that will look like the following:

            A         
               Ackerlight 
                  Ackerlight1.mod
            B
               Backlash
                   Backlash1.mod

USAGE of the script:
MOVEDIRSTOALPHASUB.BAT  [SOURCEDIR]  [DESTDIR]
 
[SOURCEDIR] - Optional - Source Directory
[DESTDIR]   - Optional - Destination Directory

   1: @ECHO OFF
   2: CLS
   3: REM ============================================================
   4: REM MOVE Subfolders and their content (including their subdirectories)
   5: REM to Destination Folder by First Letter of the Subfolder Name
   6: REM  
   7: REM Source:
   8: REM   axxxxxx     DIR
   9: REM     xxxxxxx   DIR
  10: REM       yyyyyyy FILE
  11: REM     yyyyyyy   FILE
  12: REM
  13: REM Destination:
  14: REM   A             DIR
  15: REM     axxxxxx     DIR
  16: REM       xxxxxxx   DIR 
  17: REM         yyyyyyy FILE
  18: REM       yyyyyyy   FILE
  19: REM 
  20: REM USAGE:
  21: REM MOVEDIRSTOALPHASUB.BAT  [SOURCEDIR]  [DESTDIR]
  22: REM 
  23: REM [SOURCEDIR] - Optional - Source Directory
  24: REM [DESTDIR]   - Optional - Destination Directory
  25: REM
  26: REM Written by Roy/SAC in 2009
  27: REM 
  28: REM ============================================================
  29:  
  30: REM Backup original directory location
  31: SET ORG=%CD%
  32:  
  33: REM If no source directory is specified
  34: REM use current directory location as source
  35: IF "%~1"=="" (
  36:   SET SROOT=%CD%
  37: ) ELSE (
  38:   SET SROOT=%~1
  39: )
  40: REM If no destination directory is specified
  41: REM use current directory as destination
  42: IF "%~2"=="" (
  43:   SET DROOT=%CD%
  44: ) ELSE (
  45:   SET DROOT=%~2
  46: )
  47:  
  48:  
  49: REM Goto Source Directory
  50: CD /D "%SROOT%"
  51:  
  52: REM Get all Sub-Folders in Source Directory
  53: for /f "tokens=*" %%A in ('DIR /ON /B /AD *.* 2^>NUL') DO CALL :ACTION "%%~A"
  54:  
  55: REM Return to Original Directory
  56: CD /D "%ORG%"
  57: ECHO ===============================================
  58: ECHO DONE! Window Closes Automatically in 10 Seconds
  59: ECHO ===============================================
  60: GOTO :ENDOFAPP
  61:  
  62: REM ===========================================================
  63: REM ACTION - Folder Processing
  64: REM ===========================================================
  65: :ACTION
  66: REM Extract Folder Name
  67: SET STR1="%~nx1"
  68:  
  69: REM Extract First Letter of Folder Name
  70: SET "STR=%STR1:~1,1%"
  71:  
  72: REM Convert Letter to Upper Case
  73: for %%X in ("a=A" "b=B" "c=C" "d=D" "e=E" "f=F" "g=G" "h=H" "i=I"
  74:             "j=J" "k=K" "l=L" "m=M" "n=N" "o=O" "p=P" "q=Q" "r=R"
  75:             "s=S" "t=T" "u=U" "v=V" "w=W" "x=X" "y=Y" "z=Z") do (
  76:     call set "STR=%%STR:%%~X%%"
  77: )
  78:  
  79: REM Jump to destination directory
  80: CD /D "%DROOT%"
  81:  
  82: REM If letter directory does not exist, create it
  83: IF NOT exist "%STR%" MD "%STR%"
  84:  
  85: REM Jump into letter directory
  86: CD /D "%DROOT%\%STR%"
  87:  
  88: REM If target directory does not exist, create it
  89: IF NOT exist "%~nx1" MD "%~nx1"
  90:  
  91: REM copy all files and subfolders from source to target directory
  92: XCOPY /S /E "%SROOT%\%~nx1\*.*" "%DROOT%\%STR%\%~nx1" 2>NUL 
  93:  
  94: REM Jump to source directory
  95: CD /D "%SROOT%\%~nx1"
  96:  
  97: REM Delete all files in source directory
  98: DEL /S /Q *.* 2>NUL
  99:  
 100: REM Jump to root source directory
 101: CD /D "%SROOT%"
 102:  
 103: REM Remove source directory and its sub directories
 104: RMDIR /S /Q "%~nx1" 2>NUL
 105: GOTO :EOF
 106:  
 107:  
 108: REM ===========================================================
 109: REM End of App - Script closes automatically after 10 seconds
 110: REM ===========================================================
 111: :ENDOFAPP
 112:  
 113: FOR /l %%a in (10,-1,1) do (
 114:   TITLE %title% -- closing in %%as&ping -n 2 -w 1 127.0.0.1>NUL
 115: )
 116: TITLE Press any key to close the application&ECHO.

MoveToAlphabetSubFolders.bat


This script simply moves files in a folder to sub folders with the first letter as name. For example, if you have a folder with the following files:

Ackerlight1.mod
Backlash1.mod

The script will move them to subfolders like this:

A
   Ackerlight1.mod
B
   Backlash1.mod

Note: this version of the script overwrites files with the same name in the destination folder. Check out the script below, which does the same as this script, but does not overwrite files in the destination directory.


   1: @ECHO OFF
   2: CLS
   3: IF NOT {%1}=={} (
   4:   CD /d "%~1"
   5: )
   6: ECHO Processing Folder: %CD%
   7:  
   8: FOR %%f IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z REST) DO 
       CALL :MoveFiles "%%f"
   9: GOTO :EOF
  10:  
  11: :MoveFiles
  12: ECHO Processing: %1 ...
  13: IF %1=="REST" Goto :MoveRest
  14: IF NOT EXIST %1 MD %1
  15: REM FOR %%f IN (%1*) DO MOVE "%%f" %1>NUL
  16: move %1* %1\ >NUL 2>&1
  17: GOTO :EOF
  18:  
  19: :MoveRest
  20: IF NOT EXIST 0-9 MD 0-9
  21: MOVE * 0-9>NUL
  22: GOTO :EOF

MoveToAlphabetSubFoldersWithoutOverwrite.bat


This script does the same as the one above with the difference that this script does not overwrite files with the same name that already exist in the destination directory.


   1: @ECHO OFF
   2: CLS
   3: IF NOT {%1}=={} (
   4:   CD /d "%~1"
   5: )
   6: ECHO Processing Folder: %CD%
   7: ECHO ------------------------------------------------------------------------------------------
   8: FOR %%f IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z REST) DO 
        CALL :MoveFiles "%%f"
   9: ECHO ------------------------------------------------------------------------------------------
  10: ECHO Done!
  11: ECHO.
  12: PAUSE
  13: GOTO :EOF
  14:  
  15: :MoveFiles
  16: ECHO Processing: %1 ...
  17: IF %1=="REST" Goto :MoveRest
  18: IF NOT EXIST %1 MD %1
  19: REM FOR %%f IN (%1*) DO MOVE "%%f" %1\ >NUL 2>&1
  20: Echo N|move /-Y %1* %1\ >NUL 2>&1
  21: RmDir "%1">NUL 2>&1
  22: GOTO :EOF
  23:  
  24: :MoveFiles2
  25: Echo N|move /-Y %1* 0-9\ >NUL 2>&1
  26: GOTO :EOF
  27:  
  28: :MoveRest
  29: IF NOT EXIST 0-9 MD 0-9
  30: FOR %%a IN (0 1 2 3 4 5 6 7 8 9 # $ % ~ ! ^ & ( ) - _ + = [ ] { } ' ; , `) DO 
       CALL :MoveFiles2 "%%a"
  31: RmDir "0-9">NUL 2>&1
  32: GOTO :EOF

MoveToSubFoldersByExt.bat


This script requires also the .VBS script “Extensions.vbs” (see below).

It sorts files away into sub directories with the extension name. I used it to sort away tracker modules by file format. For example:

   Ackerlight1.mod
   Backlash1.xm

Would be moved into folders like this:

   MOD
       Ackerlight1.mod

   XM
       Backlash1.xm


   1: @ECHO OFF
   2: CLS
   3: IF NOT {%1}=={} (
   4:   CD /d "%~1"
   5: )
   6: Set WorkP=%CD%
   7: ECHO Processing Folder: %WorkP%!
   8: Call :GetScrPath "extensions.vbs"
   9: Echo [%CmdL%]
  10: FOR /F %%f IN ('%CmdL%') DO CALL :MoveFiles "%%f"
  11: Call :MoveRest
  12: GOTO :EOF
  13:  
  14: :MoveFiles
  15: IF NOT EXIST "%~1" MD "%~1"
  16: FOR %%f IN (*.%~1) DO MOVE "%%f" "%~1\">NUL 2>&1
  17: GOTO :EOF
  18:  
  19: :MoveRest
  20: IF NOT EXIST "NoExtension" MD "NoExtension"
  21: MOVE "*." "NoExtension\">NUL 2>&1
  22: RmDir "NoExtension">NUL 2>&1
  23: GOTO :EOF
  24:  
  25:  
  26: :GetScrPath
  27: Set CmdL=cscript.exe /nologo "%~$PATH:1" "%WorkP%"
  28: GOTO :EOF

extensions.vbs


This is a supporting script for the batch script “MoveToSubFoldersByExt.bat”. It returns a list of all file extensions for the files in the provided directory location.



   1: Dim objCmdlineArguments: Set objCmdlineArguments = Wscript.Arguments
   2: Dim oFso: Set oFso = CreateObject("Scripting.FileSystemObject")
   3: Dim oFile, oFolder, sPath
   4: Dim sExt, a, aExt
   5: Dim sExtensions: sExtensions=""
   6:  
   7:  
   8: If objCmdlineArguments.Unnamed.Count > 0 then
   9:    sPath = objCmdlineArguments.Unnamed(0)
  10:    If Not oFso.FolderExists(sPath) Then
  11:       sPath = oFso.GetAbsolutePathName(".")
  12:    End If
  13: Else
  14:    sPath = oFso.GetAbsolutePathName(".")
  15: End If
  16:  
  17: Set oFolder = oFSO.GetFolder(sPath)
  18:  
  19: 'Process Files in Folder
  20: For each oFile in oFolder.Files
  21:    sExt = LCase(oFso.GetExtensionName(oFile.Name))
  22:    If sExt <> "" And InStr(1,sExtensions,sExt & "|",1) = 0 Then
  23:       sExtensions = sExtensions & sExt & "|"
  24:    End If
  25: Next
  26:  
  27: If sExtensions <> "" Then
  28:   sExtensions = Left(sExtensions,Len(sExtensions)-1)
  29:   If InStr(1,sExtensions,"|",1) > 0 Then
  30:     aExt = Split(sExtensions,"|")
  31:     sExtensions=""
  32:     QSort aExt, LBound(aExt), UBound(aExt)   
  33:     For a = 0 To UBound(aExt) 
  34:       If aExt(a) <> "" Then
  35:         sExtensions = Join(aExt,vbcrlf)
  36:        End If
  37:     Next
  38:   End If
  39:   WScript.Echo sExtensions   
  40: End If
  41:   
  42: Set oFolder = Nothing
  43: Set ofso = Nothing
  44:  
  45:  
  46: Sub QSort(aData, iaDataMin, iaDataMax)
  47:   Dim Temp 
  48:   Dim Buffer 
  49:   Dim iaDataFirst
  50:   Dim iaDataLast
  51:   Dim iaDataMid
  52:  
  53:   iaDataFirst = iaDataMin          ' Start current low and high at actual low/high
  54:   iaDataLast = iaDataMax
  55:  
  56:   If iaDataMax <= iaDataMin Then Exit Sub        ' Error!  
  57:   iaDataMid = (iaDataMin + iaDataMax) \ 2   ' Find the approx midpoint of the array
  58:  
  59:   Temp = aData(iaDataMid)                 ' Pick as a starting point (we are making
  60:                                           ' an assumption that the data *might* be
  61:                                           ' in semi-sorted order already!
  62:  
  63:   Do While (iaDataFirst <= iaDataLast)
  64:       'Comparison here
  65:         Do While aData(iaDataFirst) < Temp
  66:           iaDataFirst = iaDataFirst + 1
  67:           If iaDataFirst = iaDataMax Then Exit Do
  68:       Loop
  69:  
  70:       'Comparison here
  71:        Do While Temp < aData(iaDataLast)
  72:           iaDataLast = iaDataLast - 1
  73:           If iaDataLast = iaDataMin Then Exit Do
  74:       Loop
  75:  
  76:       If (iaDataFirst <= iaDataLast) Then        ' if low is <= high then swap
  77:           Buffer = aData(iaDataFirst)
  78:           aData(iaDataFirst) = aData(iaDataLast)
  79:           aData(iaDataLast) = Buffer
  80:           iaDataFirst = iaDataFirst + 1  
  81:           iaDataLast = iaDataLast - 1 
  82:       End If
  83:   Loop
  84:  
  85:   If iaDataMin < iaDataLast Then                 ' Recurse if necessary
  86:       QSort aData, iaDataMin, iaDataLast
  87:   End If
  88:  
  89:   If iaDataFirst < iaDataMax Then                ' Recurse if necessary
  90:       QSort aData, iaDataFirst, iaDataMax
  91:   End If
  92:  
  93: End Sub 'QSort

MP3FileSort2Dirs.bat


I published this batch script already on my blog. It sorts MP3 files away to sub directories by artist name, assuming that the MP3 files start with the artist name followed by a “-“ character (then followed by the song title for example).

   1: @echo off
   2: :: -------------------------------------------------------
   3: :: MP3 Cleanup/Sorting Batch Script
   4: :: ------------------------------------------------------- 
   5: :: 1. looks for MP3 files in current directory
   6: :: 2. looks for "-" in file name (assumed to be 
   7: ::    the separator between Artist Name and Song Title)
   8: :: 3. parses string before first "-", trims trailing spaces
   9: :: 4. checks if directory with that name exists
  10: ::   4.1 If not, it creates it (artist name)
  11: :: 5. moves file into the directory
  12: :: 
  13: :: Batch Script by Carsten Cumbrowski aka Roy/SAC
  14: :: visit http://www.roysac.com
  15:  
  16: setlocal enabledelayedexpansion
  17: cls
  18: ::only list files with extension MP3, exclude directories
  19: for /f "tokens=*" %%A in ('DIR /A-D /ON /B "*.MP3"^|SORT /REVERSE') do (
  20:   call :PERFACTION "%%~A%"
  21: )
  22: echo.
  23: echo Done!
  24: echo.
  25: pause
  26: goto :EOF
  27:  
  28:  
  29: :PERFACTION
  30: ::look for dash in file name, parse str before dash
  31: for /F "tokens=1 delims=-" %%B in ("%~1") do (
  32: ::trim trailing spaces from parsed string  
  33:     set str=%%~B%
  34:     for /l %%a in (1,1,31) do if "!str:~-1!"==" " set str=!str:~0,-1!
  35: )
  36: call :PROCFILE "%str%"
  37: goto :EOF
  38:  
  39:  
  40: :PROCFILE
  41: ::check of directory exists and move file
  42: set f2="%~1"
  43: if {%~x1}=={} (
  44:    echo %f2%
  45:    if NOT exist %f2%  MD %f2%
  46:    move "%~1*.MP3" %f2%
  47: )
  48: goto :EOF
  49:  
  50:  

MoveFilesAutoRenDup.vbs


This script copies all files from a source directory, including its subfolders to a destination directory without any subfolders. Since the subfolders of the source might contain files with the same name (such as file_id.diz files), this script automatically renames those files, appending [2] to the first duplicate, [3] to the next and so on.


   1: Dim FSO: Set FSO = CreateObject("Scripting.FileSystemObject")
   2: Dim arguments: Set arguments = Wscript.arguments
   3: Const ForAppending = 8, ForReading = 1, ForWriting = 2
   4:  
   5: Dim sTo
   6: Dim sFrom
   7:  
   8: if arguments.unnamed.count = 0 then
   9:   sFrom = "N*A"
  10:   Do While sFrom <> "" and FSO.FolderExists(sFrom) = false
  11:   sFrom = InputBox("Move All Files and Auto Rename Dupes", _
  12:           "Enter Source Directory: ", fso.GetAbsolutePathName("."))
  13:   Loop
  14:   if sFrom = "" then
  15:      WScript.Quit(1)
  16:   End if
  17: else
  18:   sFrom = arguments.unnamed.Item(0)
  19: end if
  20: if not FSO.FolderExists(sFROM) then
  21:    WScript.Quit(2)
  22: end if
  23:  
  24: if arguments.unnamed.count <= 1 then
  25:   sTo="N*A" 
  26:   Do While sTo <> "" and FSO.FolderExists(sTo) = false
  27:   sTo = InputBox("Move All Files and Auto Rename Dupes", _
  28:         "Source Directory: " & vbcrlf & sFrom & vbcrlf & _
  29:         "Enter Destination Directory: ", FSO.GetParentFolderName(sFrom))
  30:   Loop
  31:   if sTo = "" then
  32:      WScript.Quit(1)
  33:   end if
  34: else
  35:   sTo = arguments.unnamed.Item(1)
  36: end if
  37: if not FSO.FolderExists(sTo) then
  38:    WScript.Quit(2)
  39: end if
  40:  
  41:  
  42:  
  43:  
  44: Dim iFilesCount: iFilesCount  = 1
  45: Dim  sSrc, sDest, DC, sExt, sBase, oFOld
  46:  
  47: Set oFold = FSO.GetFolder(sFrom)
  48:  
  49: if lcase(sTo) <> lcase(sFrom) then
  50:   ShowFiles oFold.Path
  51: end if
  52:  
  53: ShowSubFolders oFold
  54:  
  55: Wscript.echo iFilesCount  & " files moved"
  56:  
  57:  
  58: '========================================================
  59:  
  60: Sub ShowSubFolders(Folder)
  61: Dim SubFolder
  62:  
  63:     For Each Subfolder in Folder.SubFolders
  64:           ShowFiles Subfolder.Path
  65:           ShowSubFolders Subfolder
  66:     Next
  67: End Sub
  68:  
  69: '----------------------------------------
  70: Sub ShowFiles(sPath)
  71: Dim oFile, oFolder
  72:  
  73:   iFolderCount = iFolderCount + 1
  74:   Set oFolder = FSO.GetFolder(sPath)
  75:   iFilesCount = iFilesCount + oFolder.Files.count
  76:  
  77:   For each oFile in oFolder.Files
  78:       sDest = FSO.BuildPath(sTo, oFile.Name)
  79:       sExt = FSO.GetExtensionName(sDest)
  80:       sBase = left(oFile.Name,len(oFile.name)-len(sExt)-1)
  81:       DC = 1
  82:       Do While FSO.FileExists(sDest) = true
  83: '           Wscript.sleep 500
  84:            DC = DC + 1
  85:            sDest = FSO.BuildPath(sTo, sBase & "[" & DC & "]." &  sExt)
  86:       Loop
  87:       sSrc = FSO.GetAbsolutePathName(FSO.BuildPath(sPath,oFile.Name))
  88:  
  89:       FSO.MoveFile sSrc, sDest
  90:  
  91:   Next
  92: End Sub
  93:  
  94:  

CleanUp.bat


I published this script also already. It simply checks all subdirectories of the provided path and removes all those that are empty (have no files).


   1: REM CleanUp.bat
   2: @echo off
   3: set Folder="%~1"
   4: if %Folder%=="" @echo Syntax CleanUp Folder&goto :EOF
   5: if not exist %Folder% @echo Syntax CleanUp Folder - %Folder% not found.&goto :EOF
   6: CD /D %Folder%
   7: Echo Processing Folder: %Folder%
   8: setlocal
   9: :: REMOVE EMPTY SUBFOLDERS
  10: for /f "tokens=*" %%A in ('dir /ad /s /b *.* ^|Sort /Reverse') do (
  11:  RmDir "%%A" 2>NUL
  12: )
  13: CD ..
  14: :: REMOVE FOLDER, IF EMPTY
  15: RmDir %Folder% 2>NUL
  16: endlocal

All scripts are freeware, but you are using them at your own risk. I take no responsibility for any damages or losses that result directly or indirectly from the use of those scripts.


Again, you can download the source code of all scripts in this post here: Roy-FileProcScripts.zip


Cheers!


Carsten aka Roy/SAC