c# - How Change name file after Creation in startup folder? -
i code application added startup how can after creation file (filename + ".url") change (filename + ".exe")
static string filename = "troj"; public static string tempure = environment.getfolderpath(environment.specialfolder.applicationdata) + "\\" + filename + ".exe"; public static string tempurepath = environment.getfolderpath(environment.specialfolder.applicationdata) + "\\"; public static void addtostart() { try { string deskdir = environment.getfolderpath(environment.specialfolder.startup); if (system.io.file.exists(deskdir + "\\" + filename + ".url")) return; using (system.io.streamwriter writer = new system.io.streamwriter(deskdir + "\\" + filename + ".url")) { string app = tempure; writer.writeline("[internetshortcut]"); writer.writeline("url=file:///" + app); writer.writeline("iconindex=0"); string icon = app.replace('\\', '/'); writer.writeline("iconfile=" + icon); writer.flush(); } } catch {
Comments
Post a Comment