Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

bat2exe not work win x64?

- - - - -

  • Please log in to reply
10 replies to this topic

#1
MgmTest

MgmTest

    Junior

  • Member
  • Pip
  • 61 posts
  • OS:Windows 7 x86
  • Country: Country Flag
Me Need Help For bat2exe but not working for delete files in win x64.
test in win x 86 working.

@echo off
echo.
cls
del "%ProgramFiles%\test\azqq\ Sample Image.png"
erase /q /a /s "%ProgramFiles%\test\azqq\Sample Image.png"
echo.
exit



How to remove advertisement from MSFN

#2
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,763 posts
  • OS:Server 2012
  • Country: Country Flag

Donator

Which version of Windows?

Try putting your folder someplace other than Program Files, since on more recent OSes, that is a protected location.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#3
MgmTest

MgmTest

    Junior

  • Member
  • Pip
  • 61 posts
  • OS:Windows 7 x86
  • Country: Country Flag
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?

#4
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,258 posts
  • OS:none specified
  • Country: Country Flag

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. ;)

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#5
MgmTest

MgmTest

    Junior

  • Member
  • Pip
  • 61 posts
  • OS:Windows 7 x86
  • Country: Country Flag
1) I am using win 7 x64
2) I've even tried that and I got the same the result. I also tried take ownership and the result was same.

#6
allen2

allen2

    Not really Newbie

  • Member
  • PipPipPipPipPipPipPip
  • 1,812 posts
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 by allen2, 29 October 2012 - 03:01 AM.


#7
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,418 posts
  • OS:none specified
  • Country: Country Flag
Test this on Windows 7 x64 VBS script using Admin Cmd Promt

This image show using %ProgramFiles% varibles as missing and not able to delete the folder
Attached File  ProgramFilesVaribleError1.png   101.07KB   15 downloads

This image show confirm and deletes folder using %SystemDrive%\Program Files (x86)\ to make the
path to the folder for delete.
Attached File  ProgramFilesVaribleError2.png   162.58KB   10 downloads


GunSmokingMan



#8
MgmTest

MgmTest

    Junior

  • Member
  • Pip
  • 61 posts
  • OS:Windows 7 x86
  • Country: Country Flag
Line 4 Error:

Posted Image

#9
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,418 posts
  • OS:none specified
  • Country: Country Flag
Correct Way
Dim DelPath :DelPath = Act.ExpandEnvironmentStrings

Yours The Wrong way
Dim DelPath :DelPath = Act .ExpandEnvironmentStrings
You 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


GunSmokingMan



#10
MgmTest

MgmTest

    Junior

  • Member
  • Pip
  • 61 posts
  • OS:Windows 7 x86
  • Country: Country Flag
Why?

C:\Users\Documents\Delete Software.vbs(4, 55) Microsoft VBScript compilation error: Invalid character


***** script completed - exit code: 1 *****


#11
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,418 posts
  • OS:none specified
  • Country: Country Flag
Because Wrong
( _"%sys

Correct
("%sys

Underscore is used to split a long line of code and continue on the lower line.


GunSmokingMan






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN