问题
To open an Android Virtual Device, I was recommended to add a shortcut or a batch file with the next line:
C:\android-sdk\tools\emulator.exe -avd MyAVD
Nevertheless, when I do so, this opens with a command line window, which if I close by error (Something frequently since I work with many command line windows for debugging the apps), It also closes the AVD emulator.
I want to open the AVD without the command line window, to prevent this, I was recommended to do so with cmd /c
or with start
at the beginning, but it isn't working either. Anyone can tell me how should I do this?
回答1:
You can use a VBScript to open the command prompt window hidden
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("C:\batchfile.bat"), 0, True
If you save that as .vbs
and make sure to replace C:\batchfile.bat
with the location of yours, this will run the command hidden.
回答2:
This should do it, it should run as a subprocess of taskeng.exe
in Task Manager.
schtasks -create -tn foo -tr <command> -sc once -st 00:00 -ru system
schtasks -run -tn foo
schtasks -delete -tn foo -f
ref
来源:https://stackoverflow.com/questions/14390396/open-application-with-hidden-cmd-exe