windows - Difference between manual deletion and deletion by a script?! (bat or vbs) -


I am currently trying to automatically delete a program's files while running the program. If I manually delete files in Windows, but not if I delete files with a script then the changes in the program are recognized.

All files are deleted, however. I tried a bat and a VBS script, by calling the script manually and / or from within the program - always with the same result: Manual deletion is recognized, the script is not deleted. I should mention that it is important to me that I can make a script / executable call, which automatically removes files, from LUA 4.0.

What exactly happens if I delete a file in Windows and the way it is different to delete it by a script? Is there a way to remove 100% of simulation windows? Or is there some secret folder 'update' flag, which I do not know? Natural Folder Properties Update DateLastAccessed and DateLastModified are updated.

Here are my script to perfection (he fitting destroy any existing file * Random * .level and remove empty folder):

bAT:

  REM delete all "random" map del / s * random * .level the REM empty folders / f "delims =" %% d ( "dir / S / B / A: D ^ | sort / r ') Delete ""% d ""   

VBS:

  file system object' Set objShell = CreateObject ("Wscript.Shell") by creating 'get current path strpath = objShell.CurrentDirectory' T oFSO = CreateObject ( "Scripting.FileSystemObject") '' set in the random level files ProcessSubFolders oFSO.GetFolder (strPath) sub ProcessSubFolders (oFolder) deleted check 'folder every file for each oFile cFiles the cFiles = oFolder Find all files in files if it is a level file and its name is "random", if true (offline name, lane (". Level")) = ". Level "and" Insert "(OFFL .name," Rendo Meter ") then 'true if delete it oFile.Delete then the next' oFolder.SubFolders ProcessSubFolders oSubFolder Next procedure for each oSubFolder in the same manner all subfolders' folder empty so oFolder.SubFolders.Count = 0 and oFolder.Files .Count = 0 then delete "it oFolder.Delete the End Sub    

Shell.AppLink Object file is capable of executing system tasks as they were, for example For, the folder.copyier method allows you to create zip files as a copy in those files. You can see the file copy progress bar and everything.

So in detail , a Shell.Application using the object to be treated to remove the file manually file deletion There is a small jscript script that I tested his theory of Had written to:

  var shl = new ActiveXObject ( "Shell.Application"); Var item = shl.NameSpace ("c: \\ user \\ me \\ desktop"). item (); For (var i = 0; i & lt; Aitmkkount; i ++) {if (/\.tmp$/i.test(items.Item(i).Name)) {WSH.Echo (removal ' '+ Item Item (my name); items.Item (i) .VokeVerb (' destroyed ');}}   

... which will be * from * to my desktop. Unfortunately, as it is, encounter for each .tp file, I get a confirmation window dialog, "do you really want to send this file to the recycle bin?" On cursor check, this is the files Instead of deleting, take the files into a temporary folder. Remove, then delete the folder. I'm not sure whether it will satisfy your conditions, but I think it's worth the experiment.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -