hi, i have to make a IM program with C and i was wondering if anyone knows a way to access dos commands with C, like net send i was thinking to use rpc (remote procedure call) for windows, so if anyone have any suggestion please let me know

Dani AI

Generated

As noted, the goal is a small IM program in C that can send messages between machines; correctly observed that invoking OS shell commands from C is possible but fragile. The best long‑term approach is to implement messaging with supported IPC/network APIs rather than relying on legacy command utilities or shelling out, because those utilities vary by Windows version and often lack authentication or encryption.

For networked messaging, use sockets (Windows Sockets on Windows) for client/server or peer‑to‑peer transport and choose a discovery method (LAN broadcast or a central rendezvous server) to find peers. For same‑machine communication, named pipes or other local IPC are simpler and more reliable. Microsoft documentation for these APIs is available at the Windows Sockets start page, the Named Pipes reference, and the RPC start page for those who still want an RPC design.

Architectural and operational tips: pick client/server when NAT traversal, persistence, or message routing is needed; pick peer‑to‑peer for very small LAN tools. Frame messages (length prefix or line breaks), handle concurrency via nonblocking I/O or I/O completion ports on Windows, and plan for firewalls and NAT. For secure transport, use TLS (SChannel or an SSL/TLS library) and authenticate clients before accepting messages.

Practical shortcuts and compatibility notes: domain/terminal scenarios can use the supported session messaging utility on modern servers (see the Windows msg command), and mature messaging protocols like XMPP offload presence, routing, and interoperability if reuse is acceptable. Avoid executing shell commands for IPC because of permission, portability, and injection risks; prefer direct API calls or well‑maintained libraries instead.

References: Windows Sockets start page, Named Pipes, , I/O completion ports, msg command, XMPP.

Recommended Answers

All 2 Replies

Assuming you are writing a C console program then use the system() function. MS-DOS has been dead on PCs for 10+ years now, but still used in some old embedded systems.

thnks i ll look it up

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.