Jump to content

lloydie2009

Member
  • Posts

    1
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

Everything posted by lloydie2009

  1. Hello, OK, let's test your skills because mine are cak. Can someone turn that into a VBS file, preferably so if there are any errors, it doesn't skip to the end of the file (the issue I'm having now, if it fails, it still deletes the folder) cd c:\local set /P username="Enter Target Username" takeown.exe C:\Users\%username% /D Y /F cacls c:\users\%username% /t /e /g Administrators:f robocopy c:\users\%username% c:\local\profilebackup\%username% /E /R:1 /W:1 remprof %username% rd /s /q c:\users\%username% Here's my attempt: I am trying to create a VBS to take ownership of a user input parameter folder, and then copy that to another location however am having issues. I think it's the ownership bit that causing a problem which if run in a single script works fine, and is only when trying to add the robocopy section of the script I am having issues. I'm afraid I have limited knowledge, and there is no error that appears, it prompts for the username as it should, and then closes a few moments later, it would appear when it hit's the robocopy section, however if you then look at c:\users, ownership has not been taken. Set objSysInfo = CreateObject("ADSystemInfo") Set objNetwork = CreateObject("Wscript.Network") Set objFSO = CreateObject("Scripting.FileSystemObject") strsUsername = InputBox ("please enter target username") Set objShell = CreateObject("Wscript.Shell") objShell.Run "takeown.exe /F C:\users\"&sUsername&"" objShell.Run "robocopy.exe c:\users\"&sUsername&" c:\local\profilebackup\localprofile /e /zb /R:3 /W:2" Any suggestions on how i can accomplish this would be great, i need to have a InputBox as this is for Admin to use from different accounts, so the script cannot auto-determine the folders. Many Thanks
×
×
  • Create New...