Sign in to follow this  
Followers 0
Garrett19212

Run a txt file?

3 posts in this topic

Iv tried Run, to open a txt file but it didn't work, how would i open a txt file, in the same folder as the script?

Share this post


Link to post
Share on other sites



Thx, the first one didn't work, but the second one did.

Share this post


Link to post
Share on other sites

Func to start any file type with its associated program:

Func _ShellExecuteDllCall($sCmd, $sVerb = 'Open', $sArg = '', $sFolder = '')
   Local $aRet
   
   $aRet = DllCall("shell32.dll", "long", "ShellExecute", "hwnd", 0, "string", $sVerb, _
         "string", $sCmd, "string", $sArg, "string", $sFolder, "long", @SW_SHOWNORMAL)
   
   If $aRet[0] > 32 Then
      Return 1
   Else
      Return 0
   EndIf
  ;return will be 0 if something goes wrong.
EndFunc  ;==>_ShellExecuteDllCall

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0