Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Copy files as admin

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,59889
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Copy files as admin
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Copy files as admin - 5/6/2008 8:31:39 AM   
  WombatBob

 

Posts: 2
Score: 0
Joined: 5/6/2008
Status: offline
I am very, very new to VBScripts, but I am trying to delete a file from the local workstation and copy a new file from a network drive to the local machine.  The problem I face is with rights; the file I need to delete is in c:\documents and settings\all users\start menu\programs, and users in my org don't have the ability to delete from or copy to this directory.  The following is what I am trying to do in .bat form but again, I am very light on knowledge when it comes to scripting of this sort:

del "C:\Documents and Settings\All Users\Start Menu\Programs\PROGRAMXXX.lnk"
copy "\\SERVERYYY\PROGRAMZZZ.lnk" "C:\Documents and Settings\All Users\Start Menu\Programs" /Y

Once again, this must be done as domain admin due to the rights on the share and local machines.  Any help would be appreciated greatly.  Thanks.

-Bob
 
 
Post #: 1
 
 RE: Copy files as admin - 5/6/2008 6:45:46 PM   
  _o0o_

 

Posts: 8
Score: 0
Joined: 5/6/2008
Status: offline
the problem come from netbios , gpo rights or acl's ?
differents solutions could come pending it.

at any case , try psexec from sysinternals , you can call it from a bat script or vbs too , with this tool you can execute on local or remote machines with the desired rights , also you can try with runas.exe.

(in reply to WombatBob)
 
 
Post #: 2
 
 RE: Copy files as admin - 5/7/2008 5:51:51 AM   
  WombatBob

 

Posts: 2
Score: 0
Joined: 5/6/2008
Status: offline
Actually, I was hoping to be able to do this with a VB script.  I don't want to use runas due to the cleartext displaying of any passwords, and although I have used programs in the past to encrypt the contents of the script, I would rather not go down that route with this.  So, can this copy be done with a VB script?  

(in reply to _o0o_)
 
 
Post #: 3
 
 RE: Copy files as admin - 5/7/2008 6:27:21 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
To delete as and admin you must provide the credentials of an admin. So regardless of the method you use you must put the username and password somewhere.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to WombatBob)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Copy files as admin Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts