Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [Tutorial] Using Shell commands in turing
Index -> Programming, Turing -> Turing Tutorials
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DaVe g




PostPosted: Sun Sep 19, 2004 10:34 am   Post subject: (No subject)

nobody will make viruses with this info?

Laughing
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Sun Sep 19, 2004 10:40 am   Post subject: (No subject)

DaVe g wrote:
nobody will make viruses with this info?

Laughing


No more dnageruges then any real lang and u could not format the main hard drive just by using that comand. Whould have to reporgame some of the boot files to do that Rolling Eyes
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
jeffgreco13




PostPosted: Thu Jun 05, 2008 11:03 am   Post subject: Re: [Tutorial] Using Shell commands in turing

HEY HEY, I wrote this back in the day lol.

Oh and it's very possible to make a virus with this info lol. More or less a very very very annoying one rather than something really destructive.

Then again, with the right commands and the right files deleted... who knows......

Not giving any ideas or anything.
Tony




PostPosted: Thu Jun 05, 2008 11:20 am   Post subject: Re: [Tutorial] Using Shell commands in turing

jeffgreco13 @ Thu Jun 05, 2008 11:03 am wrote:
Oh and it's very possible to make a virus with this info

No. No, you cannot make a virus with that.


Posted Image, might have been reduced in size. Click Image to view fullscreen.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
jeffgreco13




PostPosted: Thu Jun 05, 2008 11:24 am   Post subject: Re: [Tutorial] Using Shell commands in turing

well that just made me bite my tongue lol... thanks for the info tho
Insectoid




PostPosted: Thu Jun 05, 2008 3:42 pm   Post subject: RE:[Tutorial] Using Shell commands in turing

Well, almost the exact code can be typed into any text program and saved as batch file. The only difference is that it works over networks and thus requires the computer's 'name'. In my compsci class, 9-10 kids found out how to open the remote shutdown dialog box, and were wreaking havoc in class. So I wiki'd remote shutdown and found the direct shutdown code, wrote one for every computer in the room, and shut down every person who had ever shut me down. I really had the upper hand, because they had to go to the dialog box and manually change settings, while I just had to click an icon! It didn't help that the computer names are all printed on the computer cases...

I did eventually delete all my codes and swap out my computer's hard drive to change the name. Now, when someone tries to shut me down, the computer of the very guy who started the whole shutdown thing will go off. They all think I implemented some genious code to cause codes to rebound of my computer!

good times...

Oh, and my friend wrote a code in turing that would delete all system files on the computer, so EXTREMELY malicious software can be created in turing.
Xypher




PostPosted: Thu Jan 08, 2009 1:27 pm   Post subject: Re: [Tutorial] Using Shell commands in turing

I have a question...I see it opens a new command window every time. I want to go to a directory to copy one file into another. I thought by default it would run the file from the directory the .t or .exe doing this is located in. Apperantly it doesn't so I would like it to run something like this:

code:
U:
cd:\<directory>
copy /b fileout + filein outputfile


I will obiously be reciving input for the name of the drive they're using to take into consideration some people may have it on another hardrive or partition, and a directory. Other than that the file already asks for the files being worked with. The code looks like this

code:
setscreen("nocursor")
   var x,y:int
   var filein,fileout,name,fin:string
put"This program is designed to embed one file into another.",skip,"Please make sure that the files are in the same directory as this program!",skip
put"Press any key to continue!"
 Input.Pause
 cls
 setscreen("cursor")
put"Please enter the name of the file which will be embedded in the target file!",skip,skip,"File Name: "..
 color(red)
   get filein
 color(black)
 cls
put"Please enter the name of the target file which will contain the file:",skip,skip,"File Name: "..
 color(red)
   get fileout
 color(black)
 cls
put"Please enter the name of the file that will be a product of the target file:",skip,skip,"File Name: "..
 color(red)
   get name
 color(black)
 cls
put"EMBEDDING..."
fin:="copy /b "+fileout+" + "+filein+" "+name
 system(fin,x)
 cls
put"Embedding complete!",skip,skip,"Enter '1' to delete the original files or '0' to close this program: "..
   get y
 cls
if y=1then
   fin:="del "+filein
 put fin
    system(fin,x)
   fin:="del "+fileout
 put fin
    system(fin,x)
end if



Thanks for any help Smile.


EDIT: I'm also unsure how to type something such as '\Administrator' in a put statment as I get the error "Illigal extended character in string literal". Anybody have a fix for this?
Nick




PostPosted: Thu Jan 08, 2009 3:17 pm   Post subject: RE:[Tutorial] Using Shell commands in turing

code:
put Dir.Current


is that what you want?

Quote:
I'm also unsure how to type something such as '\Administrator' in a put statment as I get the error "Illigal extended character in string literal". Anybody have a fix for this?


try \\Administrator
Sponsor
Sponsor
Sponsor
sponsor
Xypher




PostPosted: Fri Jan 09, 2009 3:33 pm   Post subject: Re: [Tutorial] Using Shell commands in turing

Not quite but that's a useful command to know. I want to know how to navigate to a directory, then excecute a comman which embeds one file with another. Basically if somebody could show me a quick example program on how to move one file to another location it would help...I just really need to be able to excecute 2 statments in the same command prompt.
Lekegolo killer




PostPosted: Wed Jan 14, 2009 1:12 pm   Post subject: Re: [Tutorial] Using Shell commands in turing

ReN3g@de @ Tue Mar 09, 2004 10:59 pm wrote:
You can use Shell commands in Turing and do such things as Restart, Shutdown, etc. LOL!! but be wise these commands could be used for evil things so use this information usefully!

First off here's the syntax:
code:
system ( command : string, var ret : int )


Your Shell command goes in the command : string area
and the return variable goes in the var ret: int area.

For every command run there is an interger that is returned to determine if the command worked properly or if not then what went wrong...

code:
var ret: int
system("cmd",ret)

This program will make the command prompt open

Here are the possible errors (the lines before the numbers are needed, they're negatives):
0 Works properly
-1 Not enough memory to load command.com
-2 Not enough memory to run command
-3 Argument list greater than 128 bytes or environment info
is greater than 32k
-4 Couldn't find command.com
-5 command.com is corrupt
-6 -noshell option is selected, the system procedure is
disallowed

To interpret these errors you could set up an if statement to see whether the execution has worked...

code:
var ret: int
system("cmd",ret)
if ret=-7 then
   put "Command cannot be found"
end if

some thing along these lines will do just fine!

code:
var ret: int
system("shutdown -s -c message-here",ret)

This program will shutdown the computer...
the -s means shutdown you can change it to -r to reboot... but the -c must stau the same!
the message here part is a message that appers... because this form of shutting down makes a message prompt appear counting down 30 seconds till shut down and a message is written below. There cannot be any spaces or the command will not work!

Thats all for today boys and girls hope you liked it!!



My friend can do all this stuff in notepad.
[Gandalf]




PostPosted: Wed Jan 14, 2009 4:29 pm   Post subject: RE:[Tutorial] Using Shell commands in turing

I doubt it. Notepad is a text editor, much like the one the Turing environment provides. You probably mean he can do this stuff by making batch (*.bat) files or similar.
ritama




PostPosted: Tue Oct 22, 2019 4:10 am   Post subject: Re: [Tutorial] Using Shell commands in turing

Turing will probably tell you the internal ip address of your system, which is usually 192.168.1.1, When on the internet, you external IP address is given.
basiblaster




PostPosted: Fri Nov 29, 2019 8:55 am   Post subject: RE:[Tutorial] Using Shell commands in turing

hey, just wondering, how would you get the output from the terminal and put it on the turing window?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 28 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: