giggity Posted July 14, 2006 Share Posted July 14, 2006 Code: RunAsSet("user","domain","password") DirMove("%SYSTEMDRIVE%\Documents and Settings\All Users\Start Menu\Programs\Symantec Client Security","%SYSTEMDRIVE%\Documents and Settings\All Users\Start Menu\Programs\Utilities",1) RunAsSet() I can't get this script to work. I am trying to run the script from a network share for a user that doesn't have admin rights. Any thoughts? I think the problem is the path. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2006 Developers Share Posted July 14, 2006 Code:RunAsSet("user","domain","password")DirMove("%SYSTEMDRIVE%\Documents and Settings\All Users\Start Menu\Programs\Symantec Client Security","%SYSTEMDRIVE%\Documents and Settings\All Users\Start Menu\Programs\Utilities",1)RunAsSet()I can't get this script to work. I am trying to run the script from a network share for a user that doesn't have admin rights. Any thoughts? I think the problem is the path. Any help would be appreciated.Sure.... RunASSet() ONLY sets different credentials for the Run() and RunWait() ....NOT any other commands.You need to restart you script to accomplish that ... I've posted that solution many times so I am sure you can find it ..... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
i542 Posted July 14, 2006 Share Posted July 14, 2006 (edited) Code:RunAsSet("user","domain","password")DirMove("%SYSTEMDRIVE%\Documents and Settings\All Users\Start Menu\Programs\Symantec Client Security","%SYSTEMDRIVE%\Documents and Settings\All Users\Start Menu\Programs\Utilities",1)RunAsSet()I can't get this script to work. I am trying to run the script from a network share for a user that doesn't have admin rights. Any thoughts? I think the problem is the path. Any help would be appreciated.Solution 1\1:You can use RunAsSet ONLY for Run and RunWait command.This function allows subsequent Run and RunWait functions to run as a different user (e.g. Administrator).So, this script can not be runned.i542EDIT: You need be administrator to run this script. Edited July 14, 2006 by i542 I can do signature me. Link to comment Share on other sites More sharing options...
MHz Posted July 14, 2006 Share Posted July 14, 2006 I understand what JdeB is saying, as searching the forum is over looked. But I see a path issue also perhaps. So yet again, I will offer a possible generic solution. If $CMDLINE[0] And $CMDLINE[1] = '/admin' Then ; Now admin, do the task DirMove(@UserProfileDir & '\..\All Users\Start Menu\Programs\Symantec Client Security", "' & _ @UserProfileDir & '\..\All Users\Start Menu\Programs\Utilities"', 1) Else ; No parameters then restart as admin RunAsSet("user","domain","password") Run('"' & @ScriptFullPath & '" /admin') EndIf Your %SystemDrive% would not expand unless an Opt('ExpandEnvStrings', 1) is set to enable this. Link to comment Share on other sites More sharing options...
giggity Posted July 14, 2006 Author Share Posted July 14, 2006 Sure.... RunASSet() ONLY sets different credentials for the Run() and RunWait() ....NOT any other commands.You need to restart you script to accomplish that ... I've posted that solution many times so I am sure you can find it .....Ok RunAsSet aside, I still can't get Dirmove to work. If I replace %systemdrive% with c: the script works fine running it locally on an admin account. Any thoughts on whats going on with the path name? Thanks. Link to comment Share on other sites More sharing options...
i542 Posted July 14, 2006 Share Posted July 14, 2006 Ok RunAsSet aside, I still can't get Dirmove to work. If I replace %systemdrive% with c: the script works fine running it locally on an admin account. Any thoughts on whats going on with the path name? Thanks.Are you been v2 user? Replace it with @HomeDrive for drive you running. %systemdrive% is AutoIt v2 special variable, I think .i542 I can do signature me. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2006 Developers Share Posted July 14, 2006 Ok RunAsSet aside, I still can't get Dirmove to work. If I replace %systemdrive% with c: the script works fine running it locally on an admin account. Any thoughts on whats going on with the path name? Thanks.Easiest way to debug this is to show a msgbox() with the info you want to know just before the dirmove().If you want the environment variables be translated you will have to set the appropriate OPT("ExpandEnvStrings",1) for it. Else it wil not be translated. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2006 Developers Share Posted July 14, 2006 %systemdrive% is AutoIt v2 special variable, I think Nah not really... its an Environment variable used in the good old DOS days ...... ( and still in many windows programs) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
i542 Posted July 14, 2006 Share Posted July 14, 2006 Nah not really... its an Environment variable used in the good old DOS days ...... ( and still in many windows programs) Yeah, but it doesn't work it AutoIt, isn't that? i542 I can do signature me. Link to comment Share on other sites More sharing options...
MHz Posted July 14, 2006 Share Posted July 14, 2006 Yeah, but it doesn't work it AutoIt, isn't that? i542True except for Opt('EvpandEnvStrings', 1) , and... $systemdrive = EnvGet('Systemdrive') Err hint...Reply #4? Or did I make a boo boo there? 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