-3

嗨..我正在寻找一个可以在java中返回启动文件夹路径的函数希望在windows xp/7/vista上工作

Windows 中的启动文件夹是其中所有应用程序在登录时启动的文件夹。它应该看起来像这样:

C:\Users\USR_NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

4

2 回答 2

2

这应该这样做:

File f = new File(".");
String startupFolder = f.getCanonicalPath();
于 2012-12-21T09:36:35.153 回答
1

You can do this:

File file = new File("");
String path = file.getAbsolutePath());

If you define no path in the File constructor, it assumes the current directory.

Did you mean this?

Edit: I guess not. Sorry, if you don't post a clear question, i can't help. You should read Stackoverflow FAQ and SSCCE

于 2012-12-21T09:39:14.440 回答