Advertisement
5_2007-2008 Files/ File Controls/ Input/ Output #173880

all kinds of cool ways of using the shell command

These different ways of using the shell command will let you : Launch files without knowing the associated program(doc,bmp,zip,etc), copy files and complete directories, run dos commands, launch a browser, launch an email client with almost all fields prefilled(including body!) and loads of stuff you might think of.

AI

Résumé par IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Code source
original-source
'The vbhide makes sure that ppl dont see that ugly dosbox
Shell ("c:\windows\command\xcopy /e /i /r c:\temp d:\NewTemp"), vbHide
' will create a directory called NewTemp on d: and copy
' all the files and directories recursively from c:\temp
' into it, without showing the dosbox
' you can also run any commands like del, dir, etc
' by running command.com
shell("command.com /c PathandFileToRun Commuters CommandLine"), vbHide
' /c tells command.com to run a command and exit
' you could run somethin like :
Shell ("command.com /c dir /b d:\ > dListing.txt"), vbHide
' and recover all the names of the files in d:
' or run files associated to programs(doc,zip,bmp,etc)
' by using the start command, windows will launch the
' file with the appropriate program
Shell ("start C:\WINDOWS\HELP\WINHLP32.HLP"), vbHide
' if you need even more dos power then you could just as easily run
' some bat files to do bigger operations. I think
' windows scripting host can do some awesome stuff too
' but im not familiar with it at all. All i know is
' that it lets you write javascript and vbscript like
' batch files.
Shell ("start http://www.whatever.com"), vbHide
'Will launch the default webrowser on that page

Shell ("start mailto:me@test.com,next@next.com?cc=whoever@whetever.com&subject=whatever&body=your text"), vbHide
'launch the default email client with most fields prefilled.
'im sure you can attach a file, but i havent found the right
'command yet. also its VERY important the order in which the
'commands are fed. Just separate multiple adresses with a comma
'like above.
'if i find any other cool usages i'll postem up.
Upload
Commentaires originaux (3)
Récupéré via Wayback Machine