Jump to content

Simple script but can't figure out what's wrong


kenz
 Share

Recommended Posts

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

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.

 

Link to comment
Share on other sites

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

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

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...