Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

RUNAS ERROR: 87: The parameter is incorrect.


  • Please log in to reply

#1
docfxit

docfxit

    Member

  • Member
  • PipPipPip
  • 102 posts
I'm trying to run A bat file with:
%comspec% /K runas /user:scans "ScanFiles.exe"

When I run this within the current user (ATU4)
it runs fine. When I run it from a different
computer with a Remote Procedure Call I get an error SAYING:
Enter the password for scans: (I input the correct password)
Attempting to start ScanFiles.exe as user "ATUUSER4\scans" ...
RUNAS ERROR: Unable to run - ScanFiles.exe
87: The parameter is incorrect.

When I look at Security for Scanfiles.exe it shows for ATUUSER4\Scans that it has Read
and Execute rights.


I have tried changing the user to administrator with the administrator password and it
produced the same error.

Then I signed on as administrator and ran with /user:administrator it produced the same error.
Process Explorer shows CMD.exe running with the user NT Authority\System.
I expected it to be running with the user ATUUSER4\Administrator.

I don't see what would stop runas from doing what it is intended to do.

I'm running this in XP Pro sp2 NTFS "Use Simple File Sharing" is not checked.

Thank you,

Docfxit
  • 0

Advertisements


#2
Ztruker

Ztruker

    Member 5k

  • Technician
  • 7,065 posts
Hi docfxit.

What do you mean by "When I run it from a different computer with a Remote Procedure Call"? What interface are you using?

I'd like to try this to see if I can help but need to understand what (and how) you are doing this.
  • 0

#3
docfxit

docfxit

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 102 posts
Thank you for taking a stab at this.

You can read a little about a Remote Procedure Call at http://searchsoa.tec...i214272,00.html
Or you can Google it.

It's very simple. The command that Is used and works on a '98 PC is:
RUNRMTCMD CMD('C:\Batch\Scan.bat') RMTLOCNAME('192.168.1.4' *IP) RMTUSER('SCANS') RMTPWD(password)

What is supposed to happen is the remote computer runs that command with the IP address pointing to the computer I am running. It requests
the program C:\Batch\Scan.bat. It requests that it use the user SCANS on this computer and it supplies a password for the user SCANS.

I don't know if you can reproduce it but you might be able to figure out why it appears to run under the user NT Authority\System instead of SCANS and or
how I can give it the proper authority to run under NT Authority\System.

If I can get the RUNAS command to run the program ScanFiles.exe I'm hoping will map the drive and run the program.
Thank you,

Docfxit
  • 0

#4
Ztruker

Ztruker

    Member 5k

  • Technician
  • 7,065 posts
Where did you get RUNRMTCMD? It's not part of XP.

Perhaps it needs to be recompiled under XP.
  • 0

#5
docfxit

docfxit

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 102 posts

Where did you get RUNRMTCMD? It's not part of XP.

Perhaps it needs to be recompiled under XP.


The RUNRMTCMD is run from an AS/400 not a windows computer. It is provided by IBM to run a command on a PC.
The RUNRMTCMD is running and executing the bat file in windows. The problem is the RUNAS command in winodws.

I have resolved the initial error by changing the BAT file to read:
CD C:\Batch
%comspec% /K "runas /user:scans ScanFiles.exe"

I added the CD C:\Batch and that resolved the error
87: The parameter is incorrect.

Now I am getting another error saying:

Attempting to start ScanFiles.exe as user "ATUUSER4\scans" ...
RUNAS ERROR: Unable to run - ScanFiles.exe
5: Access is denied.

Any idea why I would get Access is denied?

Thank you,

Docfxit
  • 0

#6
Ztruker

Ztruker

    Member 5k

  • Technician
  • 7,065 posts
This is the help for the runas command on XP Pro.

RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/netonly] ]
		/user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/netonly] ]
		/smartcard [/user:<UserName>] program

   /noprofile		specifies that the user's profile should not be loaded.
					 This causes the application to load more quickly, but
					 can cause some applications to malfunction.
   /profile		  specifies that the user's profile should be loaded.
					 This is the default.
   /env			  to use current environment instead of user's.
   /netonly		  use if the credentials specified are for remote
					 access only.
   /savecred		 to use credentials previously saved by the user.
					 This option is not available on Windows XP Home Edition
					 and will be ignored.
   /smartcard		use if the credentials are to be supplied from a
					 smartcard.
   /user			 <UserName> should be in form USER@DOMAIN or DOMAIN\USER
   program		 command line for EXE.  See below for examples

Examples:
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

NOTE:  Enter user's password only when prompted.
NOTE:  USER@DOMAIN is not compatible with /netonly.
NOTE:  /profile is not compatible with /netonly.
Perhaps the problem is the form of /user you are using? According to this help, it should be:

/user <UserName> should be in form USER@DOMAIN or DOMAIN\USER
  • 0

#7
docfxit

docfxit

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 102 posts

Perhaps the problem is the form of /user you are using? According to this help, it should be:

/user <UserName> should be in form USER@DOMAIN or DOMAIN\USER


I have tried:
%comspec% /K "runas /user:atuuser4\scans ScanFiles.exe"
and I have tried:
%comspec% /K "runas /user:scans@atuuser4 ScanFiles.exe"

Both give the same error:
Attempting to start ScanFiles.exe as user "ATUUSER4\scans" ...
RUNAS ERROR: Unable to run - ScanFiles.exe
5: Access is denied.

Just a note: I am currently running with a Workgroup not a domain.

Thank you,

Docfxit
  • 0

#8
Ztruker

Ztruker

    Member 5k

  • Technician
  • 7,065 posts
Like you, I can make this work locally. I have no means of making an RPC call to any of my other computers in my local workgroup to test that part of it unfortunately, unless you know of some program/script I can run that will allow me to do so I'm afraid I'll have to bail out on this one.

Hmmm, try posting a link to this thread in the Network forum here, asking some of the folks there to look at this and see if they have any ideas.
  • 0

#9
docfxit

docfxit

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 102 posts
That is very nice of you to try to figure it out.

Maybe you know of some way for me to debug this. I'd be interested in finding out what object is giving the Access Denied message.

Thank you,

Docfxit
  • 0

#10
docfxit

docfxit

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 102 posts
I have fixed the problem.

I was trying to use runas because I was told when launching a program through the network it doesn't have enough authority to connect to a network drive. And I was not able to get Net Use to work which confirmed it. I got it working with AutoIt without the runas.

Thank you,

Docfxit
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP