I need to check the existence of a shortcut on the desktop of the computer, but the code below does not exit if (!File.Exists(pasta))
private void Instalando()
{
string pasta = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\estoque Box - Gerenciamento de estoque.Lnk";
if (!File.Exists(pasta))
{
MessageBox.Show(pasta);
pnInstalando.Visible = true;
pnInstalando.Enabled = true;
}
else if (File.Exists(pasta))
{
MessageBox.Show("Olá");
pbInstalando.Visible = false;
pbInstalando.Enabled = false;
pBarInstalando.Visible = false;
pBarInstalando.Enabled = false;
pbInstalado.Visible = true;
btFechar.Enabled = true;
btFechar.Visible = true;
}
}
The shortcut, even in the code it accuses the shortcut does not exist. Can anyone help me?