MSFN Forum: file listing - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

file listing batch file Rate Topic: -----

#1 User is offline   sweept 

  • Junior
  • Pip
  • Group: Members
  • Posts: 55
  • Joined: 08-November 05

Posted 06 March 2008 - 05:10 AM

.. a simple batch that passes 1% to "any odd commands" but so it works on multiple files in selections..
.. after some files are selected...they can be sent to a batch... the batch recalls the files and recharges a predefined command for them ...

any help with this will be great!


TIA

This post has been edited by sweept: 08 March 2008 - 09:55 PM



#2 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,239
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 06 March 2008 - 07:24 AM

So you want to give the CMD file a wild card file list *.txt a?c.txt, or listed individual files a.txt b.txt c.txt, or do you want to drag selected files onto the icon and have them processed?

#3 User is offline   sweept 

  • Junior
  • Pip
  • Group: Members
  • Posts: 55
  • Joined: 08-November 05

Posted 06 March 2008 - 10:00 AM

OK, allow me to refine what ill need that IMO it will make things simpler

"a batch file that lists out the files dropped over end echo's out all files to a one liner output (file.ext,file.ext,file.ext)"

so actually the files are dropped over the batch & echo's the files out to a temp.txt ,with files listed on to one line

after some searching this is what i could come up with ,i wont paste it here as it isn't exactly what we need here

http://www.hydrogenaudio.org/forums/lofive...php/t54776.html

Ive tried making something out of it with nothing so far ,so if it isn't much to ask, please help in writing the batch

thanks again :hello:

This post has been edited by sweept: 08 March 2008 - 05:24 PM


#4 User is offline   sweept 

  • Junior
  • Pip
  • Group: Members
  • Posts: 55
  • Joined: 08-November 05

Posted 08 March 2008 - 03:52 PM

:whistle:

This post has been edited by sweept: 08 March 2008 - 05:25 PM


#5 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 08 March 2008 - 07:19 PM

Since cmd promt is not my best, here is a VBS script that should do what you want.
Save As ListDir.vbs

Quote

Option Explicit
 Dim Act :Set Act = CreateObject("Wscript.Shell")
 Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
 Dim F1, F2, F3, F4, F5, ParentFolder, Ts
 Dim A1
 A1 = vbCrLf & "------------------------------" & vbCrLf
  If WScript.Arguments.Count = 0 Then
   MsgBox "Error: This Needs At Least One Foldr Drop On This," & vbCrLf & _
		  "Script To Be Able To List It Sub Folder",4128,"Error No File"
  Else   
   For Each F1 In WScript.Arguments
	If Right(InStr(F1,"."),5) Then
'-> If You Want To List Files Only Code Here
	 Else
'-> List Contents Of Parent Folder
	  Set ParentFolder = Fso.GetFolder(F1)
'-> Open The Text File 
	  Set Ts = Fso.CreateTextFile(ParentFolder.Name & ".txt")
	   Ts.WriteLine " Start Time " & Time() & A1	
	   F4 = F4 & ParentFolder.Path & A1
		For Each F2 In ParentFolder.Files
		 F4 = F4 & F2.Name  & vbCrLf
		Next
		 F4 = F4 & A1
'-> List Contents Of Parent Sub Folder
		For Each F3 In ParentFolder.SubFolders
		 F4 = F4 & F3.Path & A1 
		For Each F5 In F3.Files
		 F4 = F4 & F5.Name & vbCrLf
		Next 
	   Next
	  End If
	Next
   End If
   Ts.WriteLine F4
   Ts.Close()
   Act.Run(Chr(34) & ParentFolder.Name & ".txt" & Chr(34)),1,True


#6 User is offline   sweept 

  • Junior
  • Pip
  • Group: Members
  • Posts: 55
  • Joined: 08-November 05

Posted 08 March 2008 - 11:14 PM

so we have a VBS for this.. thanks Gunsmoking, lets see what the batch cmd geni comes up with, for this now :hello:

#7 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,118
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 09 March 2008 - 07:28 AM

Just copy and paste the following into a new cmd file, select multiple files and drag and drop them onto it:
@echo off & setlocal
for %%# in (%*) do call set var=%%~nx# %%var%%
echo:%var%
pause & goto :eof
Let me know if this is what you wanted!

#8 User is offline   sweept 

  • Junior
  • Pip
  • Group: Members
  • Posts: 55
  • Joined: 08-November 05

Posted 09 March 2008 - 10:09 AM

thanks a bunch for letting me out of this cell! ...you defiantly gave me something to work with
ill try experimenting some if i fall again into some jam ill jump right back here for you're asistents
thanks for all the help guys it means a lot! :hello:

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy