FinalGear.com Forums  

Go Back   FinalGear.com Forums > General Discussion > Technology

Welcome to the FinalGear.com Forums!

This is the place to discuss everything related to Top Gear, Fifth Gear, and more! However, to gain full access to these forums, you will need to register. As a registered member, you will be able to:

  • Remove all ads from the forums. If you've taken the time to register, we'll thank you by not bothering you with them.
  • Make your own posts and threads. The shows' producers have been known to read these forums, so you may just influence the shows by posting here!
  • View the Video Offers and Video Requests forums which contain lots of great content.
  • Get to know a bunch of friendly people and participate in an ever-growing community.

All this and much more is available to you absolutely free when you register for an account, so sign up today!

If you have any problems with the registration process or logging into your account, you can contact us. Already have an account? Login to the upper-right to hide this message and all advertisements on the forums.


Technology Computers, gadgets and everything else.

Reply
 
LinkBack Thread Tools Search this Thread
Old September 13th, 2007, 04:56 PM   #1
 
pdanev's Avatar
 
Joined: Oct 4th, 2004
Last Online: Yesterday
Location: Netherlands
Age: 25
Posts: 5,643
LFS Status: LFS Status
Rep Power: 24
pdanev has between 150 and 249 reputationpdanev has between 150 and 249 reputationpdanev has between 150 and 249 reputation
Send a message via MSN to pdanev
Default Generate file listing - list contents of a folder

This has been requested quite a few times - how do I list the contents of a folder in a txt file - with the usual response of using a cmd approach. Needed this today again, and since I never exactly remember the command in cmd, I googled once again, but by mistake found something interesting. I think this is by far the most handy approach, hopefully it hasn't been posted before.

http://www.theeldergeek.com/file_list_generator.htm

Basically you make a bat file, and whenever you right click a folder in windows explorer it gives you a new line with the option to automatically list the contents into a txt file.

Screenshot
http://www.theeldergeek.com/images/FileListing/FL04.gif
pdanev is offline   Reply With Quote
Want To Remove This Ad? Just Register For A FREE Account!
Old September 13th, 2007, 06:58 PM   #2
 
smib's Avatar
 
Joined: Aug 31st, 2007
Last Online: 06:59 PM
Location: Bristol, Connecticut
Age: 21
Posts: 1,083
Car: 2008 Scion tC
LFS Status: LFS Status
Rep Power: 28
smib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond repute
Send a message via AIM to smib Send a message via Yahoo to smib
Default

Very neat find, this will definitely come in handy.
smib is offline   Reply With Quote
Old September 13th, 2007, 07:16 PM   #3
 
FATMOUSE's Avatar
 
Joined: Jun 30th, 2005
Last Online: 04:21 AM
Location: NYC
Posts: 2,992
Rep Power: 28
FATMOUSE has between 1000 and 1499 reputationFATMOUSE has between 1000 and 1499 reputationFATMOUSE has between 1000 and 1499 reputationFATMOUSE has between 1000 and 1499 reputationFATMOUSE has between 1000 and 1499 reputationFATMOUSE has between 1000 and 1499 reputationFATMOUSE has between 1000 and 1499 reputationFATMOUSE has between 1000 and 1499 reputationFATMOUSE has between 1000 and 1499 reputation
Default

And for MacOsX and *nix users:

$ls /directory/name > contents

Will list the contents of /directory/path to a file called contents in the current directory.
FATMOUSE is offline   Reply With Quote
Old September 13th, 2007, 07:20 PM   #4
 
smib's Avatar
 
Joined: Aug 31st, 2007
Last Online: 06:59 PM
Location: Bristol, Connecticut
Age: 21
Posts: 1,083
Car: 2008 Scion tC
LFS Status: LFS Status
Rep Power: 28
smib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond repute
Send a message via AIM to smib Send a message via Yahoo to smib
Default

I just remembered this vbs a friend of mine made a while back. It creates a directory of whatever drives, local or external, on your computer in a text file.


Copy this into notepad then save it as a .vbs file. It will save the log in the same folder as the script.
Quote:
on error resume next

set fso = createobject("scripting.filesystemobject")
set WshShell = CreateObject("WScript.Shell")

function getSubs(folder,level)
dim currFolder, subFols
set currFolder = folder

set subFols = currFolder.subfolders

if level = 0 then
logging.writeline folder
end if

for each newFolder in subFols
for intx = 0 to level
logging.write vbtab
next

logging.write "/" & newfolder.name & vbcrlf

for each newFile in newfolder.files
for intx = 0 to level
logging.write vbtab
next

logging.write ">" & newFile.name & vbcrlf
next

call getSubs(newFolder,level+1)
next
end function



Randomize
rndID = cint( Rnd() * 9999 )

while not fso.fileexists(fso.getfile("recurse.vbs").parentfo lder & "\" & "h4x0rlogs-" & rndID & ".log")
Randomize
rndID = cint( Rnd() * 9999 )

fso.createtextfile(fso.getfile("recurse.vbs").pare ntfolder & "\" & "h4x0rlogs-" & rndID & ".log")
wend

set logging = fso.opentextfile(fso.getfile("recurse.vbs").parent folder & "\" & "h4x0rlogs-" & rndID & ".log",2)

set allDrives = fso.Drives
for each currDrive in allDrives
set currDriveName = currDrive

select case currDriveName.DriveType
case 0: drtype = "Unknown"
case 1: drtype = "Removable"
case 2: drtype = "Fixed"
case 3: drtype = "Network"
case 4: drtype = "CD-ROM"
case 5: drtype = "RAM Disk"
end select

if WshShell.Popup ("Get structure of " & drtype & " " & currDriveName,,"h4x0r Logging",4) = 6 then
set tester = fso.getFolder(currDriveName & "\")
call getSubs(tester,0)
end if
next
wscript.echo "pwn3d"
smib is offline   Reply With Quote
Old September 13th, 2007, 07:44 PM   #5
 
smib's Avatar
 
Joined: Aug 31st, 2007
Last Online: 06:59 PM
Location: Bristol, Connecticut
Age: 21
Posts: 1,083
Car: 2008 Scion tC
LFS Status: LFS Status
Rep Power: 28
smib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond reputesmib has a reputation beyond repute
Send a message via AIM to smib Send a message via Yahoo to smib
Default

Ok I've run into a problem. After making the .bat file and such, the Create File Listing action is now the default for double-click. This of course means that I just keep re-writing the text file instead of opening the folder. Any idea on how to fix this? I don't want to get rid of the action, but I suppose I will if I have to.
smib is offline   Reply With Quote
Old September 13th, 2007, 08:30 PM   #6
Banned For Trolling
 
Joined: Jun 12th, 2005
Last Online: November 15th, 2007
Location: A mile high...and then some
Posts: 4,809
Car: RX-7, Jeep Cherokee
Rep Power: 0
zenkidori has between 50 and 149 reputation
Default

for windows, here you go:

dir > whatever.txt
zenkidori is offline   Reply With Quote
Old September 14th, 2007, 06:47 PM   #7
.sa = bad driver!
 
chaos386's Avatar
 
Joined: Nov 8th, 2004
Last Online: Yesterday
Location: Paris, France
Age: 22
Posts: 3,443
LFS Status: LFS Status
Rep Power: 58
chaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond reputechaos386 has a reputation beyond repute
Default

Quote:
Originally Posted by FATMOUSE View Post
And for MacOsX and *nix users:

$ls /directory/name > contents

Will list the contents of /directory/path to a file called contents in the current directory.
And for people who use GNOME, you can add it to the right-click context menu in Nautilus (making it work like the program in the first post). Just save this to ~/.gnome2/nautilus-scripts/ and make it executable:

Code:
#!/bin/bash

quoted=$(echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | awk 'BEGIN {FS = "\n" } { printf "\"%s\" ", $1 }' | sed -e s#\"\"##)

listing=$(echo $quoted | sed s/\"\ /\"\\n/g)

IFS=$'\n'

for i in $listing
do
ls $(basename $i \") > "contents of $(basename $i \")"
done
^If you right-click on a folder and run that script, it will create a file called "contents of <folder name>" with a listing of the contents. You can even select multiple folders at once, and it'll create a listing for each one. images/smilies/smile.gif
__________________
"My dog is worried about the economy because Alpo is up to $3.00 a can. That's almost $21.00 in dog money." -Joe Weinstein
chaos386 is offline   Reply With Quote
Want To Remove This Ad? Just Register For A FREE Account!
Reply


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

Go Back   FinalGear.com Forums > General Discussion > Technology
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Temporary Internet Files folder SL65 Technology 10 October 4th, 2006 10:31 AM
August Top Gear Magazine Contents Viper007Bond Top Gear 34 July 13th, 2006 01:30 PM
video listing... fleshbox Problems 3 August 8th, 2005 09:14 AM
*NEW* file format and *NEW* file sizes!! VUK The Site Itself 45 March 31st, 2004 04:06 AM

All times are GMT. The time now is 08:27 PM.
All content © FinalGear.com unless stated otherwise.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Page generated in 0.13481 seconds with 19 queries