LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-26-2004, 03:08 AM   #1
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Rep: Reputation: 30
Unhappy exec question


i`m trying to make an autorun interface for a cd with borland c++ builder and i`m not able to get the exec function to work. I try to make explorer.exe to run by doing this execl("C:\Windows\explorer.exe",NULL); This doesn't do anything.
What can I do ?
Please Help
 
Old 12-26-2004, 01:21 PM   #2
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
I don't understand your question, are you programming for windows or Redhat ?
On windows you want to look at ShellExecute() to do what you are seeking. Note that the ShellExecute does not replace the current process however like exec will.
You can also take a look at CreateProcess().
 
Old 12-26-2004, 04:30 PM   #3
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
One more thing, don't hard code the path to explorer because its different on some OS versions, ShellExecute() will find it without you specifying the path to it. You want to say ShellExecute("explorer /e:C:\"); if I remember correctly, the /e: switch opens the explorer to a specific directory and can highlight a specific file for you if that is what you specify after the switch. I don't know how to open the explorer on the CDROM specifically, its most often D:\ but you never know for sure... you see what I mean?

I sincerely apologize for talking windows api in this forum, but I'm assuming original poster wants his CD to be cross platform. Good luck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
exec function in C... Scrag Programming 2 12-18-2004 01:08 PM
c++ exec fosh Programming 2 07-04-2004 10:44 AM
find -exec question eantoranz Linux - General 1 06-26-2004 10:57 AM
find -exec cricbk Linux - Newbie 4 01-05-2004 07:03 PM
cannot exec as person Linux From Scratch 5 12-19-2003 04:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration