locked
copy files from network with limited rights RRS feed

  • Question

  • I need to copy files from network on regular basis and this exercise is being done from 100 XP PCs, users used to use batch file for copying files but now they dont have CMD access and batch file cannot be run. Is there any way to run vbs file or anything else to copy files so user can run it with normal user limited credential.
    Any solution for this is highly appreciated

    Wednesday, July 13, 2011 10:06 AM

All replies

  • Not as far as I can see.  That's what credentials are for.  If they do not have rights to run batch files, then they can't run batch files.  The only way would be to supply them with local administrator credentials, so that they can use the 'runas' command, or have the batch file run as a scheduled task as a user who has sufficient rights.
    Wednesday, July 13, 2011 12:11 PM
  • If I am not wrong I think it can be done using batch file alternatives like vbs scripts etc
    Wednesday, July 13, 2011 1:12 PM
  • Hi Salluu,

    Whatever scripting language you use, the script will still run under the credentials of the user who started it. 

    I think what you are thinking of is 'hiding' the credentials in a calling file.  But unfortunately, 'runas' does not have a password parameter.  It must be entered at run-time.  And to my knowledge (and I hope someone can tell me I'm wrong), no scripting language can emulate an administrator without a run-time password.



    But you would be better asking this question in the scripting forum: http://social.technet.microsoft.com/Forums/en-US/ITCG/threads
    Wednesday, July 13, 2011 1:39 PM
  • Thank you BigTeddy for taking time for my query, what if we provide password in VBS file and pass the credential
    Wednesday, July 13, 2011 6:26 PM
  • The following code is a vb script that calls the ping utilty:

    Dim str_host
    Set objshell = CreateObject("wscript.shell")
    str_host = "127.0.0.1"
    objshell.exec("ping " & str_host)
    
    

    As you can see, the line that executes the command, objshell.exec("dosomething.exe")

    simply wraps the 'dos' command in a shell, and executes it as it would be executed from the command line.  There is no magic here.  So you are still stuck with something like:

    objshell.exec("runas /user:administrator mybatch.cmd")

    which doesn't help at all.  Do you see what I mean?

    Wednesday, July 13, 2011 6:42 PM
  • Yes ofcourse, obshell.exec is also calling command through command line which is actually a problem otherwise we can execute directly the batch file instead of using script 
    Thursday, July 14, 2011 11:22 AM
  • OK, Salluu,

    Here is your answer:  Put the batch file in a Scheduled Task, and set the credentials of the task correctly.  Then let users run the task on demand, or you can have the task run automatically.

    Post back here if you are unsure of what I mean.

    • Proposed as answer by Bigteddy Saturday, July 16, 2011 10:47 PM
    Thursday, July 14, 2011 2:09 PM