Jump to content

Recommended Posts

Posted

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()
Posted (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 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.

 

Posted

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()
Posted

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.

 

Posted

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

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
  • Recently Browsing   0 members

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