![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | dos command How can I insert a Dos command in VBS script. I am trying to move: from c:/temp/myvbs2.txt c:/temp/folder1 I am not familiar with VBS but it would be nice to know how to do it using Visual Basic. Also, I am also trying generate an email once the VBS script ends can someone please provide some guidance on that. thank you |
My System Specs![]() |
| | #2 (permalink) |
| | Re: dos command "rogv" <rvaedex23@xxxxxx> wrote in message news:7d351b8b-4a72-41e1-ba52-19917dd8979b@xxxxxx Quote: > > How can I insert a Dos command in VBS script. > I am trying to move: > > from c:/temp/myvbs2.txt c:/temp/folder1 > > I am not familiar with VBS but it would be nice to know how to do it > using Visual Basic. > > Also, I am also trying generate an email once the VBS script ends can > someone please provide some guidance on that. > > thank you script56.chm from the Microsoft site to get the basic stuff. There is no need to shell out to the Command Prompt. Have a look here for an example to execute a shell command from within VB Script: http://www.microsoft.com/technet/scr...6/hey0817.mspx. You could use this code to send a message: schema = "http://schemas.microsoft.com/cdo/configuration/" Set objEmail = CreateObject("CDO.Message") With objEmail .From = "roger@xxxxxx" .To = james@xxxxxx .Subject = "Test Mail" .Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog" .AddAttachment "d:\Testfile.txt" With .Configuration.Fields .Item (schema & "sendusing") = 2 .Item (schema & "smtpserver") = "mail.roger.com" .Item (schema & "smtpserverport") = 25 .Item (schema & "smtpauthenticate") = cdoBasic .Item (schema & "sendusername") = "roger@xxxxxx" .Item (schema & "sendpassword") = "rogerspassword" End With .Configuration.Fields.Update .Send End With |
My System Specs![]() |
| | #3 (permalink) |
| | Re: dos command "rogv" <rvaedex23@xxxxxx> wrote in message news:7d351b8b-4a72-41e1-ba52-19917dd8979b@xxxxxx Quote: > > How can I insert a Dos command in VBS script. is execute a native operating system command from a vbscript, correct? If so, this is done with either the .run method or the .exec method of the WshShell object: ..run: http://msdn.microsoft.com/en-ca/libr...ky(VS.85).aspx ..exec: http://msdn.microsoft.com/en-ca/libr...4a(VS.85).aspx Quote: > I am trying to move: > > from c:/temp/myvbs2.txt c:/temp/folder1 something that can be done directly in vbscript using the .move method of the file object or the .movefile method of the file system object.: ..move: http://msdn.microsoft.com/en-ca/libr...67(VS.85).aspx ..movefile: http://msdn.microsoft.com/en-ca/libr...a6(VS.85).aspx Quote: > I am not familiar with VBS but it would be nice to know how to do it > using Visual Basic. > > Also, I am also trying generate an email once the VBS script ends can > someone please provide some guidance on that. email infrastructure. /Al |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Running a command from inside a script, command line is corrupted | PowerShell | |||
| What is the command line command for unzipping files? | Vista General | |||
Make a command prompt run a command as soon as it opens? | General Discussion | |||
| Command Line Ren (Rename) command broken? | Vista General | |||
| formatting command syntax like get-help or get-command | PowerShell | |||