MgmTest Posted September 18, 2012 Share Posted September 18, 2012 Me Need Help For bat2exe but not working for delete files in win x64.test in win x 86 working.@echo offecho.clsdel "%ProgramFiles%\test\azqq\ Sample Image.png"erase /q /a /s "%ProgramFiles%\test\azqq\Sample Image.png"echo.exit Link to comment Share on other sites More sharing options...
Tripredacus Posted September 18, 2012 Share Posted September 18, 2012 Which version of Windows?Try putting your folder someplace other than Program Files, since on more recent OSes, that is a protected location. Link to comment Share on other sites More sharing options...
MgmTest Posted October 28, 2012 Author Share Posted October 28, 2012 erase /q /a /s "%ProgramFiles%\Test\Test E ff\Support Files\Plug-ins\Effects\Synthetic Aperture\(CF3 Support)\Preset Sample Image.png"I did everything but still this file in the mentioned address doesn't getting deleted in windows x64. what else should I do? Link to comment Share on other sites More sharing options...
submix8c Posted October 28, 2012 Share Posted October 28, 2012 erase /q /a /s "%ProgramFiles%\Test\Test E ff\Support Files\Plug-ins\Effects\Synthetic Aperture\(CF3 Support)\Preset Sample Image.png"I did everything but still this file in the mentioned address doesn't getting deleted in windows x64. what else should I do?DUH!!!!Which version of Windows?Try putting your folder someplace other than Program Files, since on more recent OSes, that is a protected location.%ProgramFiles% = "Program Files"1) WHAT is the x64 OS? (XP, Vista, Win7) - name it!2) Put file in NOT the "Program Files" directory for test!Repeating the same test will yield the same result. Link to comment Share on other sites More sharing options...
MgmTest Posted October 29, 2012 Author Share Posted October 29, 2012 1) I am using win 7 x642) I've even tried that and I got the same the result. I also tried take ownership and the result was same. Link to comment Share on other sites More sharing options...
allen2 Posted October 29, 2012 Share Posted October 29, 2012 (edited) My 2 cents: it could be that %programfiles% is "C:\Program Files (x86)" when interpreted with bat2exe.You'll know if you try to echo %programfiles% and pause right after.Just tried it on windows 2003 x64 and it returns "C:\Program Files (x86)" and it most likely because a 32bit process can't launch a x64 one so environment variables are set in 32bits mode after being launched from 7zipsfx 32bits.A quick and dirty trick works by replacing the 7zip x86 files with x64 ones (after unpacking bat2exe with 7zip) but upx and the reshacker present with bat2exe doesn't seems to works on x64 that so you don't get the icon and the final file isn't upxed. Edited October 29, 2012 by allen2 Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 29, 2012 Share Posted October 29, 2012 Test this on Windows 7 x64 VBS script using Admin Cmd PromtThis image show using %ProgramFiles% varibles as missing and not able to delete the folderThis image show confirm and deletes folder using %SystemDrive%\Program Files (x86)\ to make thepath to the folder for delete. Link to comment Share on other sites More sharing options...
MgmTest Posted October 30, 2012 Author Share Posted October 30, 2012 Line 4 Error: Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 30, 2012 Share Posted October 30, 2012 Correct WayDim DelPath :DelPath = Act.ExpandEnvironmentStringsYours The Wrong wayDim DelPath :DelPath = Act .ExpandEnvironmentStringsYou have a space where there is suppose to none. That is what your error is about. The period should be character 28 folowed by the Expand at 29 Link to comment Share on other sites More sharing options...
MgmTest Posted December 1, 2012 Author Share Posted December 1, 2012 Why?C:\Users\Documents\Delete Software.vbs(4, 55) Microsoft VBScript compilation error: Invalid character***** script completed - exit code: 1 ***** Link to comment Share on other sites More sharing options...
gunsmokingman Posted December 1, 2012 Share Posted December 1, 2012 Because Wrong ( _"%sysCorrect ("%sysUnderscore is used to split a long line of code and continue on the lower line. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now