(批处理文件)列出特定目录中的文件,但只列出文件名?

时间:2016-02-15 19:02:24

标签: batch-file

嗨,我是一个很新的编程和我试图在我的一个文件夹中制作批处理文件列表音乐,但我只想看到名称。我总是得到这样的东西:

  

C:\用户\塞巴斯蒂安\应用程序数据\漫游\区\音乐\ song1.mp3

这是我用的

for %%a in (%userprofile%\AppData\Roaming\Zones\Music\*.mp3) do echo %%a

有什么方法可以让它只是说 song1 或至少 song1.mp3

1 个答案:

答案 0 :(得分:1)

使用分隔符(import UIKit class ViewController: UIViewController { @IBOutlet weak var testLabel: UILabel! var string: String! required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) string = "Hello World" } override func viewDidLoad() { self.testLabel.text = self.string super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } ):

song1

FOR /?

song1.mp3

for %%a in (%userprofile%\AppData\Roaming\Zones\Music\*.mp3) do echo %%~na