Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Batch File Help


  • Please log in to reply
21 replies to this topic

#1 jlaforte

jlaforte

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:10:49 PM

Posted 26 March 2010 - 11:21 AM

Problem: When my batch file is converted to an EXE and runs, it creates a file in the temp directory. This EXE contains certain programs like "Cleanup, Dial-A-Fix". When said programs run they clean out the temp files which causes the EXE to crash after you complete them and try to move to the next step.

I am trying to locate this "C:\Users\Owner\AppData\Local\Temp\~2C1A.bat - deleted"

Now I know that the file name is different every time the EXE is ran. However when the EXE is ran without running those programs it will work fine but I still cannot find the temp file... What does the ~ mean? Any insight would be greatly appreciated...

Thanks in advance

BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:07:49 PM

Posted 26 March 2010 - 11:36 AM

"C:\Users\Owner\AppData\Local\Temp\~2C1A.bat - deleted"
Correct me if I'm wrong but I believe the last part of that message tells you exactly what happened to the file.

There's no significance to the ~ character here -- it's just the ~ character.
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 jlaforte

jlaforte
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:10:49 PM

Posted 26 March 2010 - 11:46 AM

Understood as cleanup should be deleting temp files, Why cant I find it before I run cleanup... IE Run the EXE, it should store the temp file in "C:\Users\Owner\AppData\Local\Temp\"... however it does not... When you run cleanup you will see that it does in fact remove a file from that directory. Keep in mind I have "Show hidden files" on so that is not the problem...

#4 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:07:49 PM

Posted 26 March 2010 - 11:55 AM

I'm afraid I do not understand what's going on then. When a program exits it should delete anything it puts in the temp folder. Without code to see or a program name to reference there's little I can do to answer this question.

Just because a temp file cleanup utility nuked stuff in temp does not mean that which ever program you are looking at is responsible for any files in there. Many programs dump things in temp all the time -- even the O/S itself! Therefore I fail to see how that contradicts the message. The message says the file was deleted. Therefore, it's logical to assume that the file was deleted.

Good luck!
Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#5 jlaforte

jlaforte
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:10:49 PM

Posted 26 March 2010 - 11:59 AM

Do you have team viewer?

#6 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:07:49 PM

Posted 26 March 2010 - 12:02 PM

I don't know what that is.
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#7 jlaforte

jlaforte
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:10:49 PM

Posted 26 March 2010 - 12:03 PM

Alright never mind then, Team viewer is a free program used to present your desktop or remote into someones pc... Thanks for your attempt!

#8 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:07:49 PM

Posted 26 March 2010 - 12:07 PM

Ah. Such remote access programs are frowned upon here because they are a security concern. This is the internet after all, and not everyone wants to send your computer warm fuzzies. :thumbsup:
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#9 jlaforte

jlaforte
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:10:49 PM

Posted 26 March 2010 - 12:11 PM

I hear ya, however for a simple presentation etc, however for those who know whats going on understands the possible risks... For me, I am simply trying to resolve a really stupid problem...

Can you post files on the forum? If you download cleanup452 from its site, and run the test file you will see whats going on... IE Scan the file first obviously...

#10 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:07:49 PM

Posted 26 March 2010 - 12:15 PM

I'm not going to do that. Sorry. Particularly when there are much better temp file cleaners available, such as CCleaner: http://ccleaner.com.

If you'd take the time to explain your problem in more detail, then you might have better luck getting an answer for it.

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#11 jlaforte

jlaforte
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:10:49 PM

Posted 26 March 2010 - 12:19 PM

@echo off

REM This is just a test

Echo This is just a test...
Echo.
Echo I am going to open System Management
	Pause
	sysdm.cpl
Echo.
Echo I am going to now open Add and Remove Programs	
	Pause
	appwiz.cpl
	
Echo 
Echo finished... press any key to exit
	Pause

Above is sample code... when its saved as "Test.bat" it works fine without any issues when running cleanup utils mid process... So you can open sysdm and then run cleanup and then continue and open appwiz with this batch... When the batch is converted to an EXE you cannot... the reason you cannot is because the exe creates a temp file storing the batch information IE the above information... When you run cleanup mid process it removes that temp file causing the EXE to crash...

Was that a bit better?

#12 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:07:49 PM

Posted 26 March 2010 - 12:22 PM

How are you converting the batch to an EXE?
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#13 jlaforte

jlaforte
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:10:49 PM

Posted 26 March 2010 - 12:24 PM

Quick Batch File Compiler From abyssmedia.com

I tried including the source within the executable but it still insists on creating the temp file for the reference...

#14 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:08:49 PM

Posted 26 March 2010 - 12:29 PM

I hate to jump in here, but why convert a batch file to an .exe in the first place?

#15 jlaforte

jlaforte
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:10:49 PM

Posted 26 March 2010 - 12:30 PM

I do not want people seeing the code... Sensitive information... IE FTP UN/PW etc...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users