By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,903 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,903 IT Pros & Developers. It's quick & easy.

windows&c

P: n/a
hi friends,
i want to know that is it possible to link my c programme
with folder or file in windows, so when ever i click (try to open) the
folder first my programme will execute and after that according to
result of pro. folder/file will open/remain close.
-aakash

Sep 18 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a

skyspy wrote:
hi friends,
i want to know that is it possible to link my c programme
with folder or file in windows, so when ever i click (try to open) the
folder first my programme will execute and after that according to
result of pro. folder/file will open/remain close.
-aakash
You are playing in the wrong court. For this you need to change the
windows kernel.

Sep 18 '06 #2

P: n/a
mailursu...@gmail.com wrote:
skyspy wrote:
hi friends,
i want to know that is it possible to link my c programme
with folder or file in windows, so when ever i click (try to open) the
folder first my programme will execute and after that according to
result of pro. folder/file will open/remain close.
-aakash

You are playing in the wrong court. For this you need to change the
windows kernel.
And both of you are posting in the wrong newsgroup. A Windows
specific one would be appropriate.

Sep 18 '06 #3

P: n/a
"skyspy" <sk*******@gmail.comwrites:
i want to know that is it possible to link my c programme
with folder or file in windows, so when ever i click (try to open) the
folder first my programme will execute and after that according to
result of pro. folder/file will open/remain close.
This is a Windows question, not a C question. You'll need to ask in a
Windows-specific newsgroup.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sep 18 '06 #4

P: n/a
Write a script(exe file) in the properties of the folder. Then it will
work. Try it.

skyspy wrote:
hi friends,
i want to know that is it possible to link my c programme
with folder or file in windows, so when ever i click (try to open) the
folder first my programme will execute and after that according to
result of pro. folder/file will open/remain close.
-aakash
Sep 18 '06 #5

P: n/a
utpal wrote:
Write a script(exe file)
Please don't top-post. Your replies belong following or interspersed
with properly trimmed quotes. See the majority of other posts in the
newsgroup, or:
<http://www.caliburn.nl/topposting.html>
Also don't dispense off-topic advice.

Brian
Sep 18 '06 #6

P: n/a
skyspy wrote:
hi friends,
i want to know that is it possible to link my c programme
with folder or file in windows, so when ever i click (try to open) the
folder first my programme will execute and after that according to
result of pro. folder/file will open/remain close.
Compile this program and assign it as the default application to open
TXT files. Now, when you double-click a text file there is a 50% chance
of it opening and 50% chance of nothing happening. The decision is
controlled by the program.

You can write handlers like this for most file types. But not for
folders, to my knowledge.

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(int argc, char **argv)
{
srand(time(NULL));
rand();
if(argc == 2)
{
if(rand() < RAND_MAX / 2)
{
char *buf = malloc(strlen(argv[1]) + 20);
if(buf)
{
sprintf(buf, "notepad \"%s\"", argv[1]);
system(buf);
free(buf);
}
}
}
return 0;
}

--
Simon.
Sep 18 '06 #7

P: n/a

"Default User" <de***********@yahoo.comwrote in message
news:4n************@individual.net...
Also don't dispense off-topic advice.
I believe that the OP is a friendly young man with good intentions. His
question is of the variety that we kick out the door pretty quickly in clc.
One thing you learn after a while is where programming languages stop and
OS's start. There IS intelligent life on usenet outside of this forum. It
takes a while to find, though.

What is germane to this forum? I don't know the answer to this question,
but, before tonight, I would have said that it is obsessed with finding
obscure errors. The paradoxes of finite-state automata ensure a ready
supply of these, and I think Johnny von Neumann has the last word on it:
avoid bad scenarios.

I would love to tell the story that motivates this response, but it can't be
done without telling how I intentionally hanged windows in a public emporium
using a guess from the C programming language. Ergo OT. EC
Sep 28 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.