473,811 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ok, an extreme and humble peon requests unworthy aid in writing code for ShellExecute

1 New Member
I am completely and totally new to VB so any dumbing down and/or condescension is welcome and expected.

I have been charged with the task of creating a prompt window within a folder on our network that when said folder is double clicked or "open" is selected, it will pop up and request that the user open the readme.doc.

The user can then A) skip this option, B) read the file, and C) opt to not see this window again.

Based on the code below...how much work and specifically (oh good god, SPECIFICALLY) what code needs to be present in the form to accomplish ANY of the above?

Expand|Select|Wrap|Line Numbers
  1. Private Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" _
  2.   (ByVal hwnd As Long, _
  3.    ByVal lpOperation As String, _
  4.    ByVal lpFile As String, _
  5.    ByVal lpParameters As String, _
  6.    ByVal lpDirectory As String, _
  7.    ByVal nShowCmd As Long) As Long
  8.  
  9. Private Sub CommandButton1_Click()
  10.     ShellExecute "O:\Operations\ALLGROUPS\Shutdown Planning\Shutdown Maintenance Main Menu Screen Folder Structure HowTo.docx"
  11. End Sub
  12.  
  13. Private Sub CommandButton2_Click()
  14.     End
  15. End Sub
  16.  
And this is all literal....ther e is no intention of leaving anything out. So if any of the above is "dummy code" please help.
Oct 14 '09 #1
2 1499
Dököll
2,364 Recognized Expert Top Contributor
Don't despair, newbess... you'll get it working! Thanks for posting part of your code.

Stay tuned for an expert!
Nov 9 '09 #2
vb5prgrmr
305 Recognized Expert Contributor
Okay, so you want to watch a directory, A directory on the server, and if it is opened (browsed by the user), then you want a dialog to come up with three options...

Okay watching a folder is possible...(See post by strongm...)

http://www.tek-tips.com/viewthread.cfm?qid=1568282

Now while the above if for watching changes to files, I think you can use it for watching the folder in question...

Then, more than likely you will need install this program on all the clients and run it as a service....

http://www.tek-tips.com/viewthread.cfm?qid=1471648

or if you don't want to install a vb program as a service, you may want it to run at startup and for such see...

http://www.tek-tips.com/viewthread.cfm?qid=1552522
http://www.tek-tips.com/viewthread.cfm?qid=930847



Good Luck
Nov 9 '09 #3

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

Similar topics

0
2568
by: Marcel Sammut | last post by:
Greetings, I am converting a VB6 application to .net and am having troubles trying to print a document directley to the printer. My VB6 app used the API ShellExecute method to accomplish this, however, needed the printer name, driver and port. All which were obtainable using the Printer object in VB6. Now in .net, I've tried using the System.Drawing.Printing namespace to do this, but that is unsatisfactory. So I went back to the API...
5
2851
by: Benjamin de Waal | last post by:
Hey all, I'm trying to figure out how to directly write to a device in Windows. Basically, what I'm wanting to do is create an image of a device (specifically, a CompactFlash card that uses a filesystem Windows doesn't recognise), store it as a file, modify it and dump it back to the card. Currently, in version 0.001 of my program, I'm just calling "dd for Windows" using ShellExecute - this works perfectly, but obviously this isn't...
1
2315
by: MCzajk | last post by:
Is there a function similar to ShellExecute, which I can hook to when the program is started using Start Menu icon? MCzajk
16
1691
by: codemonk | last post by:
Hi all, Is there anyone else on this board that feels Extreme Programming (although) making some great points is a little overcooked, extreme and just plain nonsense at times? Stede
11
81736
by: Le, Thanh-Nhan | last post by:
Hi, Is there a same function in .Net as API shellexecute? Thanks Nhan
1
3101
by: bugs bunny via .NET 247 | last post by:
Does anyone have actually used SetWindowsHookEx() to hook upShellExecute() so as to find what application was started bywindows or which folder is currently browsed by explorer. I knowone thing and that is ... Windows uses ShellExecute() to doalmost every task. I need some implementation help. I want to trigger an userdefined function when suppose Notepad is opened or in simplecase a messagebox that says Notepad has started. If anyone has a...
9
2035
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It also allows them to copy files from your computer to their's. It is dangerous. Avoid at all costs. CSS that isn't stored in the victim's computer. Instead it is stored in the perpetrator's PC. What it does is it reads everything on the victim's...
2
1840
by: H. Martins | last post by:
Hi. I have the following code: Option Compare Database Public Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" _ (ByVal hwnd As Long, _ ByVal lpOperation As String, _
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.