Eleven Years of Service
Posts: 10
Threads: 3
Getting VB C++ to write a batch file 10-23-2013, 02:39 AM
#1
Okay i am trying to get VB C++ to write a batch file... but I came into errors
here the script (epic fail)
Module Module1
Sub Main()
Dim objFSO, objFile, objWShell
objFSO = CreateObject("Scripting.FileSystemObject")
objFile = objFSO.CreateTextFile("Test.bat", 2, False)
objWShell = CreateObject("WScript.Shell")
objFile.Write("@echo on
title TakeOver
/max
: a()
attrib +h "%userprofile%\my documents\d.bat" >null
echo enter password to Login
set/p "pass=>"
if not %pass%==400670 goto:b
:b echo %username%
iCACLS files %username%:N
echo you have entered the wrong password goto:a
if %pass%==400670 goto:f
: f()
echo type start to begin and End to shutdown
set/p "QUESTION=>"
IF %QUESTION%==start goto :Start Explorer.exe
: b()
echo %username%
iCACLS files /deny %username%:r C:\)
objFile = Nothing
objWShell.Run("Test.bat")
wscript.quit()
End Sub
End Module
•
Eleven Years of Service
Posts: 10
Threads: 3
Getting VB C++ to write a batch file 10-23-2013, 02:39 AM
#2
Okay i am trying to get VB C++ to write a batch file... but I came into errors
here the script (epic fail)
Module Module1
Sub Main()
Dim objFSO, objFile, objWShell
objFSO = CreateObject("Scripting.FileSystemObject")
objFile = objFSO.CreateTextFile("Test.bat", 2, False)
objWShell = CreateObject("WScript.Shell")
objFile.Write("@echo on
title TakeOver
/max
: a()
attrib +h "%userprofile%\my documents\d.bat" >null
echo enter password to Login
set/p "pass=>"
if not %pass%==400670 goto:b
:b echo %username%
iCACLS files %username%:N
echo you have entered the wrong password goto:a
if %pass%==400670 goto:f
: f()
echo type start to begin and End to shutdown
set/p "QUESTION=>"
IF %QUESTION%==start goto :Start Explorer.exe
: b()
echo %username%
iCACLS files /deny %username%:r C:\)
objFile = Nothing
objWShell.Run("Test.bat")
wscript.quit()
End Sub
End Module
•
Eleven Years of Service
Posts: 10
Threads: 3
Getting VB C++ to write a batch file 10-23-2013, 02:39 AM
#3
Okay i am trying to get VB C++ to write a batch file... but I came into errors
here the script (epic fail)
Module Module1
Sub Main()
Dim objFSO, objFile, objWShell
objFSO = CreateObject("Scripting.FileSystemObject")
objFile = objFSO.CreateTextFile("Test.bat", 2, False)
objWShell = CreateObject("WScript.Shell")
objFile.Write("@echo on
title TakeOver
/max
: a()
attrib +h "%userprofile%\my documents\d.bat" >null
echo enter password to Login
set/p "pass=>"
if not %pass%==400670 goto:b
:b echo %username%
iCACLS files %username%:N
echo you have entered the wrong password goto:a
if %pass%==400670 goto:f
: f()
echo type start to begin and End to shutdown
set/p "QUESTION=>"
IF %QUESTION%==start goto :Start Explorer.exe
: b()
echo %username%
iCACLS files /deny %username%:r C:\)
objFile = Nothing
objWShell.Run("Test.bat")
wscript.quit()
End Sub
End Module
•
Eleven Years of Service
Posts: 965
Threads: 18
RE: Getting VB C++ to write a batch file 10-23-2013, 04:09 AM
#4
So you want make a program in C++ which writes a batch program?
•
Eleven Years of Service
Posts: 965
Threads: 18
RE: Getting VB C++ to write a batch file 10-23-2013, 04:09 AM
#5
So you want make a program in C++ which writes a batch program?
•
Eleven Years of Service
Posts: 965
Threads: 18
RE: Getting VB C++ to write a batch file 10-23-2013, 04:09 AM
#6
So you want make a program in C++ which writes a batch program?
•
Twelve Years of Service
Posts: 1,474
Threads: 91
RE: Getting VB C++ to write a batch file 10-24-2013, 12:04 AM
#10
As mentioned, there's no such thing as VB C++, there is VisualC++, but it's still lame. This is VB.net though, there's no C++ here period. Why would you even want to take a language like VB.net and use it to write a batch script though? That's like taking an engine out of a viper to put it in your honda civic...
•