kenz Posted September 22, 2006 Share Posted September 22, 2006 This is a simple script that prompts for a userid and password to use in a runas to launch a batch file. When I try it I get the following. The path is fine. Any ideas why this doesn't work? Thanks. Unable to execute the external program.: Run("o:\programs\sql\oneid.bat", "", @SW_MAXIMIZE) The system cannot find the path specified. $user = InputBox("Security Check", "Enter your USERID.", "") $password = InputBox("Security Check", "Enter your password.", "", "*") Local $domain = 'RB' RunAsSet($user, $domain, $password) Run("o:\programs\sql\oneid.bat", "", @SW_MAXIMIZE) RunAsSet() Link to comment Share on other sites More sharing options...
GaryFrost Posted September 22, 2006 Share Posted September 22, 2006 (edited) This is a simple script that prompts for a userid and password to use in a runas to launch a batch file. When I try it I get the following. The path is fine. Any ideas why this doesn't work? Thanks. Unable to execute the external program.: Run("o:\programs\sql\oneid.bat", "", @SW_MAXIMIZE) The system cannot find the path specified. $user = InputBox("Security Check", "Enter your USERID.", "") $password = InputBox("Security Check", "Enter your password.", "", "*") Local $domain = 'RB' RunAsSet($user, $domain, $password) Run("o:\programs\sql\oneid.bat", "", @SW_MAXIMIZE) RunAsSet() looks like your using a mapped drive The account trying to access it does not have it mapped (Admin account). Edited September 22, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
kenz Posted September 22, 2006 Author Share Posted September 22, 2006 looks like your using a mapped drive The account trying to access it does not have it mapped (Admin account). I tried using UNC and I get the following error. that's why I tried a mapped drive. Unable to execute the external program.: Run("\\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE) The parameter is incorrect. $user = InputBox("Security Check", "Enter your USERID.", "") $password = InputBox("Security Check", "Enter your password.", "", "*") Local $domain = 'RB' RunAsSet($user, $domain, $password) Run("\\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE) RunAsSet() Link to comment Share on other sites More sharing options...
GaryFrost Posted September 22, 2006 Share Posted September 22, 2006 I tried using UNC and I get the following error. that's why I tried a mapped drive. Unable to execute the external program.: Run("\\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE) The parameter is incorrect. $user = InputBox("Security Check", "Enter your USERID.", "") $password = InputBox("Security Check", "Enter your password.", "", "*") Local $domain = 'RB' RunAsSet($user, $domain, $password) Run("\\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE) RunAsSet() try: Run(@ComSpec & " /c \\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
kenz Posted September 22, 2006 Author Share Posted September 22, 2006 try: Run(@ComSpec & " /c \\d2pvs12\d142\d1group\d127\programs\sql\oneid.bat", "", @SW_MAXIMIZE) Ok now I get a DOS window that says CMD.exe was started in the following path. UNC paths are not supported. Defaulting to windows directory 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