"New Folder and Files Become Virtual" setting does not work

Issues related to Enigma Virtual Box
Post Reply
ackno
Posts: 2
Joined: Mon Mar 20, 2023 1:58 am

"New Folder and Files Become Virtual" setting does not work

Post by ackno »

I am trying to create a packed application which behaves as follows:
When the exe is run it can create files and folders inside of the directory where the exe is run from, but those files and folders will not appear in the real file system, they will only be created in memory and be visible to the exe.

I tried to make this with enigma virtual box as follows:
input file: C:\Windows\SysWOW64\cmd.exe
output file: C:\Users\User\Desktop\TEST_FOLDER\cmd_test.exe
I created "%DEFAULT FOLDER%" inside virtual box files and set its properties to "New Folder and Files Become Virtual"
under the storage tab>"save changes of virtual files to" box is NOT CHECKED
I clicked process to create cmd_test.exe
Then I ran cmd_test.exe and the cmd shell box appeared.
Then I ran command "md test" and it created a folder called "test", however this folder was created in the real file system.
I ran the command "echo hi>out.txt" and the file out.txt was created in the real file system.
How can I create cmd_test.exe such that it does not create files and folders in the real file system?
Thanks

I have tested this on:
windows 10 21H2 19044.2075
windows 10 22H2 19045.2728

I have attached my project file for this.
You do not have the required permissions to view the files attached to this post.
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: "New Folder and Files Become Virtual" setting does not work

Post by Enigma »

Hi, can you please give me a real case why do you need that?

If you will need these additional files and folders for another .exe which you plan to run through cmd also - it won't work.
Changes to virtual content (new folders and new files) are visible inside one process only, they are not being shared to another process (unless the Storage feature is used).

If you give me a real example of how and where you plan to use such functionality, I could advise you a better way.
ackno
Posts: 2
Joined: Mon Mar 20, 2023 1:58 am

Re: "New Folder and Files Become Virtual" setting does not work

Post by ackno »

Thank you for your reply.
Sorry I forgot to mention that I also had intended to turn on the "share virtual system to child processes" function.
I wanted a parent process to temporarily have access to the same files as a child process.
Enigma wrote: Mon Mar 20, 2023 3:00 pm If you will need these additional files and folders for another .exe which you plan to run through cmd also - it won't work.
Changes to virtual content (new folders and new files) are visible inside one process only, they are not being shared to another process (unless the Storage feature is used).
If I turn on "share virtual system to child processes" feature, then could I see the virtual files if I run a child process from cmd.exe? Like notepad.exe? (actually I tested this and it does appear to work.)

My intended use was this:
There is an exe that generates some output files; I will call this "child.exe". child.exe was not created by me and I do not have the source code for it and so I cannot modify it. This "child.exe" will run and produce some output files. I have made my own program that will read the output files from this "child.exe" and process them and produce it's own output. I will call this "parent.exe"

What I wanted to do was package both of these exe's together into one exe that will not use the disk for any of the output files from "child.exe".
So what I thought might be possible was:
Package parent.exe with enigma virtual box with a virtual filesystem that contains child.exe inside of a virtual folder.
When the packaged exe is run it would run parent.exe which runs child.exe inside the virtual file system. Then child.exe creates its output in the virtual file system. Because the virtual file system is shared between parent.exe and child.exe, parent.exe can see the output files and process them. Then when parent.exe is finished and terminates, the virtual file system disappears.

My testing with cmd.exe was just to see how the features of enigma virtual boxed worked to make sure that I understood. I was not intending to actually use cmd.exe in my final project.
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: "New Folder and Files Become Virtual" setting does not work

Post by Enigma »

Unfortunately, this kind of schema won't work.

The problem is that process can't share virtual files between each other, I mean changes of virtual files.
EVB has an option to share virtual content to child processes, but this means the default virtual content, i.e. the one that is specified when the file is packed. If program makes changes to virtual files, they won't be shared to child processes.

The only way that will work for you - using Storage feature. So all the changes that child process does will be saved to Storage folder where the parent exe will be able to read it. This is the only possible way to fit your needs.
Post Reply