Jump to content

RunAsWait


1bobby
 Share

Recommended Posts

Know this is something that I do not understand with the RunAs command. I have a script that runs from a memory stick that does updates to the local software and makes user configuration (logged in as the user) changes which can only run as admin . I have to get files from the network, which has hidden directories, and requires admin to get to the files. Users are part of the power users group.

This is a test script to test the feature. The script runs from the memory stick ok, but never pulls the program from the network hidden directory. I am missing something in the understanding of the RunAs command. Totally confused yet? I am è bobby

Code:

MsgBox(0, "Testing", "trying to run now", 1)

Sleep(50)

RunAsWait("bobbyb", "jupiter", "XXXXXXXXX", 1 , "\\troi\apps2$\is test\calculator.exe", "" , @SW_MAXIMIZE )

Sleep(2000)

MsgBox(0, "testing", "I ran it", 1)

Exit

Link to comment
Share on other sites

Hi 1bobby,

Please create descriptive topics.

Using one word topics makes it really difficult to use the search feature, and those that could probably answer your question will probably not even read your thread.

Doing it enough could cause your posting privileges to be taken away all together, and we don't want that :) .

Thanks.

Link to comment
Share on other sites

Passwords left in the code: BAD idea.

Both points welcomed, didn't mean to leave password in the script. Has been removed. No don't want to loose the provlige of posting, but didn't read that in the read before posting, sorry, will do better next time.

I can only think both of you for your input!

1bobby

Link to comment
Share on other sites

A process created with RunAs[Wait] (or any similar Windows functionality) doesn't inherit any network connections from the parent process.

The way that I've worked around this in the past is to have two scripts: one installed on the local machine to copy the second script from the network, run it as the alternate user, wait and delete the second afterward; and the second script which starts off by making a network connection using DriveMapAdd and then doing the rest of the tasks I needed the alternate user's privileges for doing...

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

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