ltaudio Posted July 20, 2009 Share Posted July 20, 2009 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 More sharing options...
KaFu Posted July 20, 2009 Share Posted July 20, 2009 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') OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ltaudio Posted July 20, 2009 Author Share Posted July 20, 2009 Gave it a run, seems to open and it tries to read the html file it seems instead of creating the file, I looked and the creation date has not changed since I ran it manually. Link to comment Share on other sites More sharing options...
KaFu Posted July 20, 2009 Share Posted July 20, 2009 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? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ltaudio Posted July 20, 2009 Author Share Posted July 20, 2009 upon run I get c:perl64\bin\perl.exe Link to comment Share on other sites More sharing options...
KaFu Posted July 20, 2009 Share Posted July 20, 2009 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) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ltaudio Posted July 20, 2009 Author Share Posted July 20, 2009 Excellent work KaFu, works perfectly, Thanks for your help! Link to comment Share on other sites More sharing options...
KaFu Posted July 20, 2009 Share Posted July 20, 2009 You're welcome ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now