Jump to content

Hide CMD Window


Recommended Posts

Greetings,

I have been working on writing a script to back up the my documents folder using robocopy. I have it working but I was trying to make it less intrusive to the user. I don't want it interrupting workflow just to run a back up.

I am almost there,

Here is what I started with

CODE
RunWait(@ComSpec & " /k " & "robocopy ""C:\Documents And Settings\" & $currUser & "\My Documents"" H:\ /MIR /E /V /NP /LOG:C:\BackupLogs\" & $currUser & ".txt /R:1 /W:30")

It works, it copies great. I wanted to hide the command window so I added @SW_HIDE but this didn't work.

After searching a bit I learned that the /k basically keeps the command window open after execution, so I removed it. It works, the only problem now is it flashes the command window up for a split second and then exits.

Is it at all possible to hide this completely from the users view? and interaction?

Current Script:

CODE
Run(@ComSpec & " /c robocopy ""C:\Documents And Settings\eric.bailey2\My Documents"" H:\ /MIR /E /V /NP /LOG:C:\BackupLogs\Log.txt /R:1 /W:30" )

Thank you in advance!

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