NO

Author Topic: How do I get argv[0] in windows?  (Read 3107 times)

tpekar

  • Guest
How do I get argv[0] in windows?
« on: April 24, 2014, 07:01:23 PM »
In a console program the path and program name (and suffix) is available in the argv array as argv[0].  How do I get this in windows? ???

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: How do I get argv[0] in windows?
« Reply #1 on: April 24, 2014, 07:08:49 PM »
GetCommandLine() and find first space (outside ").
Or use frankie's code from here
May the source be with you

tpekar

  • Guest
Re: How do I get argv[0] in windows?
« Reply #2 on: April 24, 2014, 08:03:39 PM »
Thanks timoVJL.  I found where I had user GetModuleFileName in a program to get it.  Have not tried GetCommandLine before.