How to get a list of files under C:\Program Files?
dir C:\"Program Files" in DOS will get me a list of files in the directory. But how could I do in Java to get the some results? To put it in two double quotes, does not work.
Any suggestions?
Here is a small Java program that will read the contents of any directory for you:
readDir.java
==========
import java.io.*;
public class readDir {
public static void main(String[] args) {
try {
String[] dirArray=new File(args[0]).list();
for (int i=0;i<dirArray.length;i++) System.out.println(dirArray[ i ]);
} catch (Throwable exception) {
exception.printStackTrace();
}Just compile the program and run it as follows:
java readDir "C:\Program Files"
;o)
V.V.
Similar Messages
-
How to get the list of files of floder
hello,
I am using Forms 6i , i want to get the list of file of the directory
which function i have to use,
thx.In this demo you will find an example
http://www.oracle.com/technology/sample_code/products/forms/6idemos.html
Regards -
How to get a list of file paths for all files used in a project
I have a project in Premiere Pro CC which has a large number of bins. A sequence in one of these bins uses files from other bins. I am trying to find the locations of all each of the files used in the project.
1) Obviously I can select each clip in the timeline and show in finder, but there a lot of clips
2) The video usage associated with each file in the project would help. However
1. I haven't found a way to display only clips that have video useage if all of the bins have not been expanded.
2. Video usage shows usage for all sequences, so one would have to manually check the pull down for each file to see if it is used in the sequence in question.
3) I tried exporting the project to final cut pro xml. The path url gives me the information that I need. For some reason, however, when I do the export only one clip's information is there, not the information for all of the other clips in the project.
4) I tired an export for speedgrade and all of the file names are there. However the paths are not.
Basically I want to find all of the files in the project and relocate them to a specific folder for that project. There's got to be a way to do this but I'm not seeing it ....Thanks for the suggestion concerning the file path. And certainly it would have been nice to have done this before beginning. However this is a project that has been around for quite a while, and the files have been moved into different bins. And now the project sequence is being revised.
So the problem is, worded slightly differently, how can I search all of the bins for the files that are used just by this sequence, ignoring the files which are used by other sequences? Or, how can I get a list of the file paths of the files that are used in the sequence? -
Urgent - How to get Default list of file handlers
Hi.
I have mad a small application in java
It has a Jlist and a button.
When the button is clicked it shows a file dialog.The file that the user selects from the dialog is listed in the Jlist.
When the user rightclicks on the JList it shows a popupmenu with a "Open" menu item which when clicked the file is opened by its default opener ie, like .doc files opened in word.
However if the file is not recognized in windows then i want to popup the list of programs from which the user can select the program he wants to open the file with..
How can that be done??
Waiting for the reply
PinjuHi.
Yes, You are right, i can get the file list by AL11.
But i need get the list in ABAP program.
So i need a function modul to get the list. If you has some sample code, it should be very nice.
Best.
Alex -
How to get the list of file from application server
Hi Expert.
I want to get the file list from dicrectory in application server
best regards.
AlexHi.
Yes, You are right, i can get the file list by AL11.
But i need get the list in ABAP program.
So i need a function modul to get the list. If you has some sample code, it should be very nice.
Best.
Alex -
How do I get a list of files in the DataDrvUser Dir programatically (no dialogs)
I have version 8.1.1292 of Diadem. I wish to get a list of files in a directory without using a dialog.
Hello Sweeten
Attached are two snipits of code, hope this helps
The following sub reads all the folders in a root folder. Note the use the FSO or file system object. The FSO has a number of properties and methods for working with files and folders, would definetly check it out.
Sub ReadProjects()
'This sub reads all the Folders in the root
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.Getfolder(RootPath_)
Set Folder = Folder.SubFolders
i=1
For Each SubFolder In Folder
LstStates.Items.add SubFolder.name,i
i=i+1
Next
End Sub
This next code snipit reads all the files of a certain extention (i.e. LPD,DAT)
Sub ReadProjectFiles()
Dim fso,PathName,LvdNames,GraNames,path
Dim x,y,z
x=1:y=1:z
=1:w=1
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.Getfolder(ProjectPath_)
Set Files = Folder.Files
For Each file In files
Select Case file.type
Case "LPD File"
LstGraph.items.add file.name , x
x=x+1
Case "DAT File"
LstData.Items.add file.name , y
y = y+1
Case "LVD File"
LstView.Items.add file.name , z
z = z+1
End Select
Next
Let me know if this is helpful
Tom Ferraro
DIAdem Product Manager
512-683-6841 -
How to get a list of every application on my computer?
I'm trying to figure out how to get a list of every application on my computer using applescript. I know it is possible for the system to do this, as evidenced by the dialog you get when you use the "choose application" function. Other examples are doing a spotlight search for "kind:app" or programs like Namely or QuickSilver.
Is there a way to do this in applescript? The only solution I've come up with so far is to use the command:
<pre>set everyapplicationaliases to choose application as alias with multiple selections allowed</pre>
and manually select all on the resulting dialog. I can then take the results and go from there, however there are a few significant problems with this approach.
1. It requires user interaction. (I have an idea for some future applications that could use this functionality if it can be done without user input.)
2. It's horribly slow. As a test run I choose all the applications from the dialog, extracted some basic info and put the result on the clipboard. It took a couple of minutes to complete this relatively basic task. In comparison, running the aforementioned spotlight search took maybe ten seconds.
Thanks in advance!
best,
peterFor these specific queries my results are...
set appList to paragraphs of (do shell script "mdfind \"(kMDItemKind = 'application'c) || (kMDItemKind = 'widget'c)\"")
3082
set appList to paragraphs of (do shell script "mdfind \"(kMDItemKind = 'Application'c) || (kMDItemKind = 'Widget'c) ||
((kMDItemContentTypeTree = 'com.apple.application') && (kMDItemContentType != com.apple.mail.emlx) && (kMDItemContentType != public.vcard))\"")
3115
I think I finally found some numbers that make sense!
When I search for Kind:Application by the Command+F method in the Finder, I get a total of 2521 items, of which 2477 are "Applications" and 44 are "Other".
(Just by eyeballing it, "Other" seems to include some Classic Apps and some .bundle files.)
The total # found by this method (2521) plus the number of Widgets found using mdfind (318) equals the number of total number of items found by spotlight (2839).
I also noticed that these numbers almost equal the spotlight number:
mdfind results for kMDItemKind:
Widgets: 318
Applications: 1684
Classic*: 795
and
Command+F "Other" items: 44
3181684+79544 = 2841
It may be a fluke that this is so close to the 2839 spotlight gives, or maybe there's an overlap somewhere...
Tying this back into my initial question, it seems like the original mdfind command for Applications is probably the best answer for what I was looking for,
since I wasn't really thinking about Classic apps and Widgets anyway. -
How to get the list of materials from Sap r/3
Hi Experts,
I have one doubt, here iam implementing
HTTP TO RFC scenario.
My doubts are------
1. Should we create DT MT MI and all (OR) not
2.In Request DT how the message structure wil be to get the list of materials from sap r/3 system as Response(Ex: Fields in the source structure).
3.Or the second thing is how to get the list of materials start with some alphabate.
Please reply me for each and every questions mentioned above. Please clarify me.
Helpful answers wil be rewarded.
Reagards
khannaHi Khanna,
<i> 1. Should we create DT MT MI and all (OR) not</i>
Yes U need to create for HTTP site...for RFC U need to import..
<i>2.In Request DT how the message structure wil be to get the list of materials from sap r/3 system as Response(Ex: Fields in the source structure).</i>
You create your own structres for Request and respoce.. and Map it with RFC..
<i>3.Or the second thing is how to get the list of materials start with some alphabate.</i>
I think it will come with acending order....
for more help go through this link
/people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC
regards,
Ansar. -
how to get reading list in my all my devices and computer (window 7). i have installed ios 6 on iphone and icloud control panel on both PC's (home and office) but i dont get updated reading list on all my devices.
Hi bluegrandpanash,
Thanks for visiting Apple Support Communities.
If you backed up your iPhone to iCloud before updating the software, first try the steps under "Restore from an iCloud backup" in this article to recover your data:
iOS: Back up and restore your iOS device with iCloud or iTunes
http://support.apple.com/kb/HT1766
Best Regards,
Jeremy -
How to get the number of files currently open?
hi,
does any one know how to get the number of files currently open in windows OS?
e.g. lets say .txt files...
any comment will be really appreciated.
thanksAssuming that you don't want to actually do this from within Java code (which would obviously require native code), here's a utility that will give you a list of which file handles are opened by which processes (on Windows):
http://www.sysinternals.com/ntw2k/freeware/handle.shtml
- K -
Sharepoint Workflow : how to get document full path + file name into variable?
Hi,
Anybody knows how to get document full path + file name into a variable in Sharepoint 2010 workflow?
Example http://sp1:80/InvoiceQueue/Shared Documents/123.pdf
I am using List Workflow which links to a document library.Hi SAMSUNG,
According to your description, my understanding is that you want to get the full path of a document in a list workflow.
You can set the variable to the Enconded Absolute URL of the document. The screenshot is my testing. In my testing (in the red area), when the title of a document was equal to the tile of the current item, set a variable to the Enconded Absolute URL of the
document. I used ‘Log to history list’ to check the value of the variable in Workflow History .
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
How to get the list of component?
How to get the list of component through java API in Adobe CQ5?
There are probably more than a few ways, but here is a little component .jsp code that uses the jcr query api to pull out all the components and list them on a page. If I know CQ, there might be a way to ask for a list of components another way though, maybe through another API, or possibly a .json url, I might remember reading something about that, somewhere, lol, but this at least gets you the list in a somewhat simple way.
Code Example:
<%@include file="/apps/psul/components/global.jsp"%>
<%@ page import="javax.jcr.*,
javax.jcr.query.*"
%>
<%
// Login to create an anonymous session on the default workspace
Session session = resourceResolver.adaptTo(Session.class);
//Declare a query for all the components in the system
String SQL = "select * from cq:Component";
//side note: if you want just the components in your site area, then make the query more like below...
// SQL = "select * from cq:Component where jcr:path like '/apps/yoursitename/%'";
QueryManager qm = session.getWorkspace().getQueryManager();
Query query = qm.createQuery(SQL, Query.SQL);
QueryResult result = query.execute();
NodeIterator nodes = result.getNodes();
while (nodes.hasNext()) {
Node node = (Node)nodes.next();
%>
<p><%=node.getName() %> (<b><%=node.getPath() %></b>)</p>
<% } %> -
How to get the list of site collections in wss 2.0 and wss 3.0
Hi,
How to get the list of site collections in wss 2.0 and wss 3.0
Please provide related articles to me
Thanks in advanceUse 11 for wss 2.0 and 12 for wss 3.0
Go to :\Program Files\Common Files\Microsoft Shared\web server extensions\11\BIN\”
stsadm.exe -o enumsites -url <root url>
to get the list of site collections and
stsadm.exe -o enumsubwebs -url <root url>
to get the list of sub sites.
http://support.microsoft.com/kb/832807
http://ServerName/_layouts/1033/Siteusrs.aspx to manage permissions -
how to get the list of only installed bundled software on mac os X through programmatically???
I think what you get is below;
App Store
Calculator
Calendar
Contacts
Dashboard
Dictionary
DVD Player
FaceTime
Font Book
Game Center
Image Capture
iTunes
Launchpad
Mail
Messages
Notes
Photo Booth
Preview
QuickTime Player
Reminders
Safari
Stickies
System Preferences
TextEdit
Time Machine
Twitter
Activity Monitor
AppleScript Editor
Audio MIDI Setup
Bluetooth File Exchange
Boot Camp Assistant
ColorSync Utility
Console
DigitalColor Meter
Disk Utility
Grab
Grapher
Keychain Access
Migration Assistant
Network Utility
RAID Utility
System Information
Terminal
VoiceOver Utility
X11
XQuartz
Note if you buy a new Mac with ML preinstalled the list may be larger. -
How to get the list of icc profile,which Photoshop loaded?
I am developing a automation plugin,but I do not know how to get the list of icc profile,which photoshop loaded.
I have read the log of "getter" and "Listener",and not find the way to get the list.Thank you for you answer.
I find a icc profile has a "internal name" which show in the color setting menu in photoshop and a "external name" which is the file name. And the "internal name" maybe different with "external name".
How I can get the "internal name" from the icc profile? I do not find the information in the ICC Profile Format Specification.
Thank you very much!
Maybe you are looking for
-
AIP-51505: General Validation Error - SFTP transport - validation disabled
Configuration : internal DC with SFTP external DC with SFTP (via proxy) Business Protocol Custom Document over Generic Exchange MLR 12? (patch 8703404) 3 environments have the same tip.properties 2 environments pick up and send all files suc
-
Adobe Acrobat 9 Pro Extended hangs for about 12 seconds ... please help!
Hi there, I'm using Adobe Acrobat 9 Pro Extended and have the following problem: I can open PDF documents just fine. But after about 3-4 seconds the program hangs / freezes for about 12 seconds. I've tried everything (defined a non-network printer as
-
Hai frnds , iam getting the eroor when i run autoconfig =========================[AutoConfig Error Report] The following report lists errors AutoConfig encountered during each phase of its execution. Errors are grouped by directory and phase. The rep
-
Hi everybody, I have a very time consuming problem with opc programming in labview: I need to write 16 bit integers with the labview opc client to the server - and I don't know how to do this because of the limitation of the labview Vi's to 32 bit in
-
Hi, First I'm new at labview , I'm trying to read 8 checkboxs vals and for each checkbox I'm queuing a single val witch will be a test. I have a problem with my for loop it simply won't update and staying at 0 val ( only one iteration ) vi is attach