public static string getCurrentFolder() { return Environment.CurrentDirectory; }
Public Shared Function getCurrentFolder() As String Return Environment.CurrentDirectory End Function
function getCurrentFolder() { return dirname(__FILE__); }
var fso=new ActiveXObject("Scripting.FileSystemObject"); var adr=(fso.GetExtensionName(url).toLowerCase()!='hta')?1:0; var dir fso.GetParentFolderName(url).substr(adr); // dir contient le répertoire d'où à été lancé le .htm/.hta
'Attention App.Path ne se termine pas forcement par un "\" App.Path
public static String getRepertoireCourant(){ return System.getProperty("user.dir"); }
#l'import qui va bien import os #la fonction def get_repertoire_courant(): return os.getcwd()
// Connaître le répertoire en cours Info(fRepEnCours()) // Une autre syntaxe de la même fonction // permet de fixer le répertoire courant fRepEnCours("C:\TEMP")
// Connatre le répertoire en cours ResRepEnCours = fRepEnCours()
sur un projet avec objet application : AppDir := ExtractFilePath(Application.ExeName); en mode console : AppDir := ExtractFilePath(ParamStr(0));
Left(CurrentDb.Name, InStrRev(CurrentDb.Name, "\"))
Dim AppPath As String Function ApplicationPath() As String AppPath = Application.StartupPath Return AppPath End Function
Function AppPath() As String AppPath = ActiveWorkbook.Path If Not RightB$(AppPath, 2) = "\" Then AppPath = AppPath & "\" End Function