string path=Application.StartupPath + "script"; string[] fileEntries = Directory.GetFiles(path); foreach (string fileName in fileEntries) { string name=Path.GetFileName(fileName); listBox1.Items.Add(name); }