Sign in to follow this  
Followers 0
Syekick

DOS CMD window stays open. How to close?

3 posts in this topic

The following runs and works fine. However, at the end, a DOS Command window stays open. How do I close that puppy?

Run(@Comspec & ' /k cipher /x c:\' & @UserName & "_" &@ComputerName & '.pfx', 'c:\')

WinWaitActive ("EFS certificate and key backup")

Send("{Enter}")

Send("{Enter}")

Send("{Enter}")

;The window above is the one that stays open.

Sleep(100) ;100 milliseconds

Run('net.exe use U: "\\testsvr\keysafe"')

Sleep(250) ;250 milliseconds

FileCopy ("c:\*.pfx", "u:")

Sleep(250) ;250 milliseconds

FileDelete("c:\*.pfx")

Sleep(50) ;50 milliseconds

Run("net.exe use /delete U:")

Share this post


Link to post
Share on other sites



The following runs and works fine. However, at the end, a DOS Command window stays open. How do I close that puppy?

Run(@Comspec & ' /k cipher /x c:\' & @UserName & "_" &@ComputerName & '.pfx', 'c:\')

WinWaitActive ("EFS certificate and key backup")

Send("{Enter}")

Send("{Enter}")

Send("{Enter}")

;The window above is the one that stays open.

Sleep(100) ;100 milliseconds

Run('net.exe use U: "\\testsvr\keysafe"')

Sleep(250) ;250 milliseconds

FileCopy ("c:\*.pfx", "u:")

Sleep(250) ;250 milliseconds

FileDelete("c:\*.pfx")

Sleep(50) ;50 milliseconds

Run("net.exe use /delete U:")

Change /k to /c
1 person likes this

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

So after a @Comspec the /C closes a dos window and the /K keeps it open (for troubleshooting and such)

Gee, I learned somthing today. 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