473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Call VB script using c++ program

22
Hi all,

I have googled and used about every search enginge I know of but came up with no results for this. I created a small C++ program to call a vbscript on a remote pc as well as write/append to a log file on local machine. Everything works fine except for me not having any code/syntax to call vbscript. If someone could lead me to a resource or reply if they have done it before, I would sincerely appreciate. Thanks to all in advance.
May 24 '07 #1
5 3138
sicarie
4,677 Expert Mod 4TB
Hi all,

I have googled and used about every search enginge I know of but came up with no results for this. I created a small C++ program to call a vbscript on a remote pc as well as write/append to a log file on local machine. Everything works fine except for me not having any code/syntax to call vbscript. If someone could lead me to a resource or reply if they have done it before, I would sincerely appreciate. Thanks to all in advance.
Have you looked into the system() command?
May 25 '07 #2
Lloydm
22
Have you looked into the system() command?

Thanks for replying but no, I have not looked into it. Any resources you have or may know of would be a plus to increase my knowledge? pLease share. Thanks in advance
May 30 '07 #3
Lloydm
22
Still searchine... Anyone?
Jun 2 '07 #4
sicarie
4,677 Expert Mod 4TB
Still searchine... Anyone?
Did you look at the link I sent? You said you hadn't look into it, but did you after I posted it? The system command should be able to do what you want.
Jun 3 '07 #5
Lloydm
22
Did you look at the link I sent? You said you hadn't look into it, but did you after I posted it? The system command should be able to do what you want.

OK, I wanna say thanks a million. program is working.
To all here's sample code


#include<iostream>
using namespace::std;

string answer="1";

int main(){
do{
cout<<"\n\n Press 1 to browse the internet?: ";
cin >>answer;

if(answer == "1"){
cout<<"\n\n Please wait..."
<<"\n Opening Notepad, please wait.....\n";
//EXECUTE NOTEPAD
system("C:\\Windows\\Notepad.exe");

//LIST FOLDER CONTENTS
system("cls");
system("dir c:\\windows\\system");

//CREATE A DIRECTORY
system("cls");
cout<<"\n\n Creating directory 'USERS', please wait...";
system("mkdir Users");

cout<<"\n\n Program will now exit...\n"
<<" ";
system("pause");
exit(1);
}
else{
cout<<"\n " <<answer
<<" is not a valid answer, try again\n";
fflush(stdin);
cout<<" ";
system("pause");
system("cls");
}
}while(answer!="1");
return 0;
}
Jun 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jimmy Jim | last post by:
Hey all, quick question to see if anyone has any ideas. I have an object: $special = new special; Let's say I have a function: class special { function outputtext() { return "test";
2
by: Greg Chapman | last post by:
I am at my wit's end trying to get information out of Streamline.net's support dept about my problem. They reply quickly enough, but seem to try and give out the least possible amount of info each...
3
by: Tubby Tudor | last post by:
What is the best way to call one python script from within another python script? For example: one.py finishes succesfully and calls two.py which finishes OK and then calls three.py Thanks...
15
by: chirs | last post by:
I am trying to understand a piece of code. In a javascrpit file, there is a function: function ItemStyle(){ var names=; addProps(this,arguments,names,true); }; In the html file, it calls...
1
by: Michael | last post by:
Hello, Not sure if this is the right message board but I have an interesting problem. Using Visual Studio .NET, C++, I want to write an all-encompassing C++ program to download new files from...
8
by: Jade | last post by:
I saw some web page saying I could do it this way in javascript: var iNumber = <%#publicvarname publicpropertyname %> but it doesn't seem to work. I have this piece of code here in...
4
by: Dave | last post by:
I have a program that I've written a class for. I need to call the function in the program from the class. When I try to call the function I receive the error, the name xxx does not exist in the...
13
by: Larry Menard | last post by:
Test code: $dbconn = odbc_connect($dbname, $username, $password); $path = "C:\Temp\myJar.jar"; $statement = "CALL SQLJ.INSTALL_JAR('file://$path', 'myJarId')"; $result = odbc_exec($dbconn,...
5
by: Ham | last post by:
Hi I am looking for a function call tree program to map the function calls of my project. I however do not want to compile my project. All the programs I have found for this require you to...
1
by: vocalise | last post by:
The title probably isn't very clear, but I haven't been able to find this problem (or I must be having problems figuring out which search strings to use) so I apologize if this has been addressed...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.