Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-23-2004, 11:50 PM   #1 (permalink)
ConcreteClam
Registered User
 
Join Date: Feb 2004
Posts: 6
ConcreteClam is on a distinguished road
Simple(?) Batch file

I'm trying to make a batch file that:

Gets a number of files inputted by the user, randomly picks that many files from a folder, and transfers them to another folder. So it would end up being something like:
Run > CMD
C:\transfer.bat 10 D:\Mp3's\ H:\

I'm making this as a little project for my USB mp3 player. Instead of going through and picking files to have on it, I'd rather run a program that surprises me on what I listen to.

I already understand about variables and basic syntax, I just don't know how to get it to pick random files, limited by a number. Thank you for any help in advance.

Edit: Or perhaps I shouldn't be using batch for this? I'm also learning Python and C...
ConcreteClam is offline   Reply With Quote
Old 08-24-2004, 04:59 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,705
redhead is on a distinguished road
I would rather make that as a C program, could be a simple "learn the core of the language" app you could play around with.

I've never found a way, to select a random number from a list with a batch file.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Reply

Bookmarks

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 01:45 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting