I want run "%systemroot%\System32\reg.exe" this file to do something, but when I use "new File("%systemroot%\System32\reg.exe");" the ActionScript cannot find file, so anyone can help me find this?
-
Are you trying to run this from an Air app, in-browser Flash Player, or standalone Flash Player?Anon.– Anon.2010-07-08 02:59:23 +00:00Commented Jul 8, 2010 at 2:59
-
Hi, Anon, I want to run this from an Air app........Qing– Qing2010-07-08 06:49:57 +00:00Commented Jul 8, 2010 at 6:49
Add a comment
|
1 Answer
Well, since AIR is multi-platform and %systemroot% works only on Windows, it's not possible. But you can make a *.bat that installs with your application.
echo %systemroot% > systemroot.txt
So, you have to execute that *.bat file one time, when you install the application. Then, you just open the systemroot.txt, read the first line, and you have what you asked for.
I hope it helps.
(Maybe not for you because this thread is so old, but for anyone that ends here searching a solution)