Riddle Riddle - 21 days ago 12
C# Question

How to open sticky notes with Process class?

I want to open windows sticky notes with process class, I already know how to do this for calculator and paint but not sticky notes. when i give it the sticky note address it doesn't open. i use a 64-bit windows. (windows form)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace main
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("mspaint");
System.Diagnostics.Process.Start("calc");
//sticky notes
System.Diagnostics.Process.Start("C:\\Windows\\System32\\StikyNot.exe");
}
}
}


it gives the exception the file can not be found, but it exist in that location.

Answer

You have to open the file from C:\Windows\Sysnative\StikyNot.exe:

System.Diagnostics.Process.Start(@"C:\Windows\Sysnative\StikyNot.exe");

Since the System32 folder on x64 systems is synthesized, calling it directly doesn't work. You have to use the Sysnative name to map the path to the 'real' system32 folder.

Comments