Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

april newsletter- ShellExecute

davidars
Beginner
572 Views

Hello

I am trying to use ShellExecute, but apparently I am doing something wrong. I am simply trying to run a dos batch file off of my hard drive. I copied code from steve L.

my code is:

filename='main.bat'
ret = ShellExecute (&
hwnd = NULL, & !!2
lpOperation = "open"C, & !!3
lpFile = trim(filename)//char(0), & !!4
lpParameters = NULL_CHARACTER, & !!5
lpDirectory = 'c:programsS_3-PGSBatch', & !!6
nShowCmd = SW_SHOWNORMAL) !!7

if (ret <= 32) then !!8
write (*,*) "Error ", ret, "opening file"
end if

999 continue
return
end

can someone help, please?

0 Kudos
2 Replies
Steven_L_Intel1
Employee
572 Views

You probably want:

lpDirectory = 'c:programsS_3-PGSBatch'C, &

0 Kudos
davidars
Beginner
572 Views
0 Kudos
Reply