Sign in to follow this  
Followers 0
ericbailey2

Hide CMD Window

3 posts in this topic

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!

Share this post


Link to post
Share on other sites



Try _RunDOS or ShellExecute


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Try _RunDOS or ShellExecute

Wow, I got it to work with your advice. I had to play with the syntax a little because I had no idea how to use either, but I got the _RunDos command to execute perfectly, thank you.

Share this post


Link to post
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
Sign in to follow this  
Followers 0