Jump to content

awstats


Recommended Posts

After hours of playing trying to get windows server 2008 to run a batch file I have ran out of options, here is what I wish to do.

The command runs fine in CMD if I navigate to the folder and run the command with the proper attributes but if I run it from c:\ with the location in the line it fails so the script needs to navigate to the proper folder and then run the script.

The folder is: C:\inetpub\wwwroot\AWStats\cgi-bin

The command is: awstats.pl -config=website -update -output -staticlinks > awstats.website.html

Link to comment
Share on other sites

Try this:

ShellExecute('C:\inetpub\wwwroot\AWStats\cgi-bin\awstats.pl','-config=website -update -output -staticlinks > awstats.website.html','C:\inetpub\wwwroot\AWStats\cgi-bin\','open')
Link to comment
Share on other sites

Try this script:

MsgBox(0,"",_FileAssociation('.pl'))

Func _FileAssociation($sExt)
    Const $ASSOCSTR_EXECUTABLE = 2
    Const $ASSOCF_VERIFY = 0x00000040

    Local $aCall = DllCall("shlwapi.dll", "int", "AssocQueryStringW", _
            "dword", $ASSOCF_VERIFY, _
            "dword", $ASSOCSTR_EXECUTABLE, _
            "wstr", $sExt, _
            "ptr", 0, _
            "wstr", "", _
            "dword*", 65536)

    If @error Then
        Return SetError(1, 0, ""); call failed
    EndIf

    If Not $aCall[0] Then
        Return SetError(0, 0, $aCall[5])
    ElseIf $aCall[0] = 0x80070002 Then
        Return SetError(0, 0, "{unknown}"); COM Error 0x80070002, ?The system cannot find the file specified.'
    ElseIf $aCall[0] = 0x80004005 Then
        Return SetError(0, 0, "{fail}"); E_FAIL
    Else
        Return SetError(2, $aCall[0], ""); dammit!!!
    EndIf

EndFunc  ;==>_FileAssociation

It should show you the associated executable for .pl files... should be perl.exe... Maybe there's the problem?

Link to comment
Share on other sites

Maybe this?

Run(@ComSpec & ' /c c:\perl64\bin\perl.exe C:\inetpub\wwwroot\AWStats\cgi-bin\awstats.pl -config=website -update -output -staticlinks > awstats.website.html', 'C:\inetpub\wwwroot\AWStats\cgi-bin\', @SW_HIDE)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...