Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: My First program!

11 May 2014   #31
Britton30
Microsoft MVP

Windows 7 Ultimate X64 SP1
 
 

Thanks UNI, I hadn't look since it was 1st posted, the page has changed. The screenshots aren't real helpful.

My First program!-harries.jpg

While I'm sure it's safe, neither Norton on MBAM will let it download for me.




My System SpecsSystem Spec
.
11 May 2014   #32
UsernameIssues

W7 Pro SP1 64bit
 
 

In Pale Moon, the light boxes look like this:

My First program!-fp1.png

My First program!-fp2.png

My First program!-fp3.png

My First program!-fp4.png

When one runs the file (in my case, inside a virtual machine without any antivirus) that app creates a and launches batch file like this:
Code:
@shift
@echo off
title Harrie Pateman's Useful Batch File! 
:home
:menu
cls
echo.
echo Select a task you wish to perform:
echo.
echo =============
echo.
echo 1) Youtube - come check me out!
echo 2) Pc Clean Up Utilities
echo 3) Shutdown In 15 Seconds
Echo 4) Random Number Password Generator!
echo 5) Matrix!
echo 6) Strobe Light!
echo.
echo =============
echo  Made by Harrie Pateman "Patemanharrie@gmail.com"
echo =============
echo.
set /p web=Type option:
if "%web%"=="1" start www.youtube.com/user/HarriePateman
if "%web%"=="2" goto Cln
if "%web%"=="3"  Start c:\windows\system32\shutdown -s -f -t 15
if "%web%"=="4" goto Pasgen
If "%web%"=="5" goto Matr
if "%web%"=="6" goto Strobe
if "%web%"=="7" 
goto home
:pasgen
cls:
Echo Your Random Password is: %random%
pause
goto :home
:cln
cls
echo --------------------------------------------------------------------------------
echo PC Cleanup Utility
echo --------------------------------------------------------------------------------
echo.
echo Select a tool
echo =============
echo.
echo [1] Delete Internet Cookies
echo [2] Delete Temporary Internet Files
echo [3] Disk Cleanup
echo [4] Disk Defragment
echo [5] Main Menu. 
echo.
set /p op=Run:
if %op%==1 goto 1
if %op%==2 goto 2
if %op%==3 goto 3
if %op%==4 goto 4
if %op%==5 Goto Home
goto error
:1
cls
echo --------------------------------------------------------------------------------
echo Delete Internet Cookies
echo --------------------------------------------------------------------------------
echo.
echo Deleting Cookies...
ping localhost -n 3 >nul
del /f /q "%userprofile%\Cookies\*.*"
cls
echo --------------------------------------------------------------------------------
echo Delete Internet Cookies
echo --------------------------------------------------------------------------------
echo.
echo Cookies deleted.
echo.
echo Press any key to return to the menu. . .
pause >nul
goto Menu
:2
cls
echo --------------------------------------------------------------------------------
echo Delete Temporary Internet Files
echo --------------------------------------------------------------------------------
echo.
echo Deleting Temporary Files...
ping localhost -n 3 >nul
del /f /q "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
cls
echo --------------------------------------------------------------------------------
echo Delete Temporary Internet Files
echo --------------------------------------------------------------------------------
echo.
echo Temporary Internet Files deleted.
echo.
echo Press any key to return to the menu. . .
pause >nul
goto menu
:3
cls
echo --------------------------------------------------------------------------------
echo Disk Cleanup
echo --------------------------------------------------------------------------------
echo.
echo Running Disk Cleanup...
ping localhost -n 3 >nul
if exist "C:\WINDOWS\temp"del /f /q "C:WINDOWS\temp\*.*"
if exist "C:\WINDOWS\tmp" del /f /q "C:\WINDOWS\tmp\*.*"
if exist "C:\tmp" del /f /q "C:\tmp\*.*"
if exist "C:\temp" del /f /q "C:\temp\*.*"
if exist "%temp%" del /f /q "%temp%\*.*"
if exist "%tmp%" del /f /q "%tmp%\*.*"
if not exist "C:\WINDOWS\Users\*.*" goto skip
if exist "C:\WINDOWS\Users\*.zip" del "C:\WINDOWS\Users\*.zip" /f /q
if exist "C:\WINDOWS\Users\*.exe" del "C:\WINDOWS\Users\*.exe" /f /q
if exist "C:\WINDOWS\Users\*.gif" del "C:\WINDOWS\Users\*.gif" /f /q
if exist "C:\WINDOWS\Users\*.jpg" del "C:\WINDOWS\Users\*.jpg" /f /q
if exist "C:\WINDOWS\Users\*.png" del "C:\WINDOWS\Users\*.png" /f /q
if exist "C:\WINDOWS\Users\*.bmp" del "C:\WINDOWS\Users\*.bmp" /f /q
if exist "C:\WINDOWS\Users\*.avi" del "C:\WINDOWS\Users\*.avi" /f /q
if exist "C:\WINDOWS\Users\*.mpg" del "C:\WINDOWS\Users\*.mpg" /f /q
if exist "C:\WINDOWS\Users\*.mpeg" del "C:\WINDOWS\Users\*.mpeg" /f /q
if exist "C:\WINDOWS\Users\*.ra" del "C:\WINDOWS\Users\*.ra" /f /q
if exist "C:\WINDOWS\Users\*.ram" del "C:\WINDOWS\Users\*.ram"/f /q
if exist "C:\WINDOWS\Users\*.mp3" del "C:\WINDOWS\Users\*.mp3" /f /q
if exist "C:\WINDOWS\Users\*.mov" del "C:\WINDOWS\Users\*.mov" /f /q
if exist "C:\WINDOWS\Users\*.qt" del "C:\WINDOWS\Users\*.qt" /f /q
if exist "C:\WINDOWS\Users\*.asf" del "C:\WINDOWS\Users\*.asf" /f /q
:skip
if not exist C:\WINDOWS\Users\Users\*.* goto skippy /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.zip del C:\WINDOWS\Users\Users\*.zip /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.exe del C:\WINDOWS\Users\Users\*.exe /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.gif del C:\WINDOWS\Users\Users\*.gif /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.jpg del C:\WINDOWS\Users\Users\*.jpg /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.png del C:\WINDOWS\Users\Users\*.png /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.bmp del C:\WINDOWS\Users\Users\*.bmp /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.avi del C:\WINDOWS\Users\Users\*.avi /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.mpg del C:\WINDOWS\Users\Users\*.mpg /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.mpeg del C:\WINDOWS\Users\Users\*.mpeg /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.ra del C:\WINDOWS\Users\Users\*.ra /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.ram del C:\WINDOWS\Users\Users\*.ram /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.mp3 del C:\WINDOWS\Users\Users\*.mp3 /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.asf del C:\WINDOWS\Users\Users\*.asf /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.qt del C:\WINDOWS\Users\Users\*.qt /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.mov del C:\WINDOWS\Users\Users\*.mov /f /q
:skippy
if exist "C:\WINDOWS\ff*.tmp" del C:\WINDOWS\ff*.tmp /f /q
if exist C:\WINDOWS\ShellIconCache del /f /q "C:\WINDOWS\ShellI~1\*.*"
cls
echo --------------------------------------------------------------------------------
echo Disk Cleanup
echo --------------------------------------------------------------------------------
echo.
echo Disk Cleanup successful!
echo.
pause
goto menu
:4
cls
echo --------------------------------------------------------------------------------
echo Disk Defragment
echo --------------------------------------------------------------------------------
echo.
echo Defragmenting hard disks...
ping localhost -n 3 >nul
defrag -c -v
cls
echo --------------------------------------------------------------------------------
echo Disk Defragment
echo --------------------------------------------------------------------------------
echo.
echo Disk Defrag successful!
echo.
pause
goto menu
:error
cls
echo Command not recognized.
:home
goto Home

:matr
:mattop
color a
echo %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% %random%
goto :mattop


:strobe
color cb
:top
echo (%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)

color 01
echo (%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)

color f2
echo (%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)

color 58
echo (%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)

color 4f
echo (%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)(%random%) (%random%) (%random%) (%random%)
goto :top
goto Menu
...and here are some of my thoughts on that batch file:
My First program!


My System SpecsSystem Spec
11 May 2014   #33
Britton30
Microsoft MVP

Windows 7 Ultimate X64 SP1
 
 

Odd, this is how it looks in Opera as well, SourceForge must have the wrong document modes, or something, set wrong.

My First program!-opera-snip.jpg


My System SpecsSystem Spec
.

11 May 2014   #34
Callender

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 
Guys - suggest that you look here

Take a look:

Looks a lot like: 5 Cool Batch Files : PC Cleanup Utility

and here it's been modified to cause a scare
Batch Utilities - Batch Professional

and also here:
Batch File Tricks (Item 4)

Comments: Hardly original and not very effective as cleanup script!

Note: Yesterday the download linked by the OP wasn't detected on VT (I scanned with PE Studio) but at the current time it is.

The script appears to want to delete all temp files on the system partition and there's lots of lines that seem pointless!

Just my opinion. :)
My System SpecsSystem Spec
11 May 2014   #35
Britton30
Microsoft MVP

Windows 7 Ultimate X64 SP1
 
 

Does VT mean VirusTotal?
My System SpecsSystem Spec
11 May 2014   #36
Callender

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 
VT means Virus Total

Quote   Quote: Originally Posted by Britton30 View Post
Does VT mean VirusTotal?
Yes it does. Sorry, should have been clear. Ran it sandboxed - no issues found.

Edit: Ran the executable sandboxed.

Ran the executable under WinDbg and it created a batch file in Appdata but I looked at the batch file without running it.


Attached Thumbnails
My First program!-virustotal-scanner-www.securityxploded-3.jpg   My First program!-report.jpg  
My System SpecsSystem Spec
11 May 2014   #37
UsernameIssues

W7 Pro SP1 64bit
 
 

I do not think that the OP was/is focusing on the batch file. As mentioned/quoted below, this exercise was to learn C++. The OP's exe creates and runs the temp file (which is the modified batch file).

Quote   Quote: Originally Posted by HLPTech View Post
Im currently learning c++ at the moment trying to extend my knowledge!
Since I have never written anything in C++, I don't know how much of a challenge this would be (create/run a file). I've done that task many times via AutoIt, but I guarantee you - if I compiled such a script - the exe would be flagged by one or more antivirus apps. That is why I ask members to just run my scripts as text files.

Edit/Update:
VirusTotal's assessment of the AutoIt script linked to above...
...when compiled:
https://www.virustotal.com/en/file/7...is/1399864691/

VirusTotal's assessment of the AutoIt script linked to above...
...when the compiling process also compresses with UPX:
https://www.virustotal.com/en/file/d...is/1399864688/
Notice the hit from MalwareBytes.

I win...
My First program!-autoit-pestudio.png
...my AutoIt script (when compiled) is more evil than the OP's :-)


Below I've attached a ZIP that contains my script.
AutoIt is distributed with several (136) scripts that you can call/include so that AutoIt users don't have to re-invent that particular wheel. I used Timer.au3 in my script, so I've included it in the ZIP in case some of you want to glance at it.

It seems like Malwarebytes is flagging the UPX compression and not the actions of the script.


Attached Files
File Type: zip idle-timer loop.zip (2.6 KB, 0 views)
My System SpecsSystem Spec
11 May 2014   #38
Callender

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 
AV Flagging

Yes I understand that if a file is flagged up it doesn't mean that it's dodgy. Especially if it's newly created.

It just seems to create a batch file - no problem there:

My First program!-warning.jpg

It doesn't seem to change anything in the registry either:

My First program!-regwatcher.jpg

Or attempt to run more than one executable or launch any scripts:

My First program!-secureage.jpg

I didn't much care for the poorly written batch file though!


My System SpecsSystem Spec
12 May 2014   #39
UsernameIssues

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by Callender View Post
~~~
I didn't much care for the poorly written batch file though!
Agreed. I mentioned that too in my earlier comments.

Perhaps the OP has learned a bit about staking one's reputation on copy/paste/edit code.
My System SpecsSystem Spec
12 May 2014   #40
UsernameIssues

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by HLPTech View Post
I promise its safe guys, honestly!
It is not safe to visit YouTube with a browser running at the high integrity level.

You app offers to do that for the user.
My System SpecsSystem Spec
Reply

 My First program!




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Program installed in Program Files requires elevation?
I have a program that wanted to install in a document folder :mad: I have installed it in Program Files, but it requires elevation or it produces errors when running. I know I can tick the Run As ... box in the shortcut, but is there a better way, such as taking ownership of the install folder?
System Security
Program refusing to install in standard program files folder
I have an Advent (PC World brand) Laptop that comes with its own custom On-Screen Display software. The software is made for 32 bit Windows with no 64 bit version available as far as I'm aware. I have upgraded to 64 bit Windows recently and everything seems to work great except the OSD. ...
Software
Sounds works except for one program, but that program shows activity
Sound generally works perfectly fine on my computer, I can watch movies, play games, etc.... Except, I recently installed the slingplayer desktop program. I do not hear any sound. However, the mixer is showing that it is generating audio. This works perfectly fine on a different computer. ...
Sound & Audio
Creating an Elevated Program Shortcut for Search Everything Program.
I`ve done this successfully for SpeedFan, but I`m having a problem with doing the same for the Search Everything program. I`ve been through the tutorial steps several times now, the task executes successfully,( I checked it with command prompt box) but nothing happens. /c start "SpeedFan"...
Software
Windows Runs Installation of Program When I Start Program
I installed Weathrbug Plus and for some odd reason recently when I run it Windows runs the installation for the program. When I run the prograsm I get the typical "Preparing to install..." abnd then tyhe 'Configuring Weatherbug. I've been in contact with Weatherbug Support all day and we can't seem...
Software
Program icon pinned to taskbar not replaced by active program button
Until recently, whenever I opened a program by clicking on the program icon pinned to the taskbar, that icon was replaced by the active program button. This is the behavior I want in order to keep the taskbar uncluttered. However, I recently mistakenly unpinned an icon for Mozilla Thunderbird and...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:45.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App