|
Where do you intend to copy the .exe FROM?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Elly08 wrote: And this copying process should be done silently without showing to user. Why? You should not be modifying the user's setup without their permission.
|
|
|
|
|
First, copying the .EXE and .DLL files you the users Desktop is a REALLY STUPID IDEA!
You INSTALL your application into a proper folder, like some folder under Program Files. You then create a shortcut to the application on the All Users Desktop or the users Desktop. This is also usually done from your installation .MSI.
Copying the application files to the Desktop gives every opportunity to the user to screw up the application since they will have full permissions to modify anything and everything on the Desktop, deleting your application files, any supporting .DLL's and configuration files, ..., what have you.
Besides, copying the files to the desktop cannot be done "silently". SUre, you can do it without showing a progress bar, BUT THE FILES WILL STILL SHOW UP ON THE DESKTOP!
|
|
|
|
|
I suspect he want to do this from a web browser
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
So do I. That's an even dumber idea and an even greater security risk.
|
|
|
|
|
Sorry, my question might not clear. What I mean here is, how do I copy the package file (not the source code) to user PC when they launch the program. I want the program will be able to copy its file from the release folder (inside the bin folder) to the temporary folder.
|
|
|
|
|
Still not clear at all.
What kind of app is this? ASP.NET, Windows Forms, WPF, ...??
How is the user launching this if it's not already on their machine?
|
|
|
|
|
My program is a Windows Form App. The .exe shortcut is inside the server so only user that connecting to the network can access it. So when the user launch it for the first time, the file from release folder will be copied to user pc in C:\Temp, if no such folder then it will be created automatically.
|
|
|
|
|
OK, that makes a bit more sense.
But, C:\Temp is not writable by everyone and not everyone will be able to create the folder unless your corporate powers-that-be have allowed that to happen.
A better alternative is C:\Users\userName\App Data\Local\Temp. This folder always exists and the user can write to it by default. The path to the Local folder can be had by calling Environment.GetFolderPath(SpecialFolder.LocalApplicationData). After that, you can append the Temp folder to the path using Path.Combine().
WARNING. Code running from a non-local source, i.e. a network share, runs in a VERY restricted sandbox and may not be able to do what you want.
On top of that, the .EXE file is LOCKED when it's running. You cannot open it to make a copy while the code is running and you cannot overwrite the .EXE if you're running the local copy of the .EXE and looking to update it from the network source.
The real question is WHY you want to do this? It serves no real purpose.
|
|
|
|
|
As I know, if user directly access the program from server, the app will load too slow. So by copying the file to local it will load more faster because everytime user launch the program, it will load the one inside the local file.
|
|
|
|
|
ClickOnce[^] might work, but it can be a bit flaky.
Alternatively, try Squirrel[^] - "It's like ClickOnce but Works™". Gregor Suttie has a walkthrough on his blog[^] which should get you started.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yeah, this is not a solution for that. You create an installer and install the app on the workstation to solve this problem. You do this either using traditional methods or ClickOnce or, as mentioned, Squirrel.
|
|
|
|
|
Would this suffice:
Creating a shortcut to that .exe, and copying that shortcut to the Desktop. All done programmatically.
|
|
|
|
|
Yeah, but that doesn't solve the problem of a long launch time when launched from a network location.
His only reasonable solution to that is to install the app locally.
|
|
|
|
|
Please let me know how to resolve the above issue
Thanks in advance
|
|
|
|
|
What does that mean? And what does it have to do with Visual Basic?
|
|
|
|
|
Hi,
I found this code on the internet. but now I want to know of a member is a group or a normal login. Someone has an idee how to find this info?
Jan
Set cmd = CreateObject("ADODB.Command")
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.Open "Provider=ADsDSOObject;"
cmd.CommandText = "SELECT adspath,cn from 'LDAP://" & getNC & _
"' WHERE objectCategory = 'Group' and cn = '" & groupname & "'"
cmd.activeconnection = cn
Set rs = cmd.Execute
'
'**
' process the results of the query into our arrays for later
'**
'
i = 0
While rs.EOF <> True And rs.bof <> True
grouppaths(i) = rs.fields("adspath").Value
groupnames(i) = rs.fields("cn").Value
rs.movenext
i = i + 1
Wend
cn.Close
If i = 0 Then
MsgBox "Nothing Found, Exiting"
Exit Sub
End If
Application.StatusBar = "Records Found..." & i
'
'**
' Turn off updates and calculations
'**
'
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayStatusBar = True
'
'**
' found something so create the output files and write the headers
'**
'
Application.StatusBar = "Creating Worksheet headers..."
If i > 0 Then
Set objsheet = Worksheets(blad)
For h = 1 To 2 '1 To numheader2
objsheet.Cells(1, h) = headers2(h)
objsheet.Cells(1, h).Font.Bold = True
Next
End If
'
'**
' now process each group found and extract all members
'**
'
cl = 1 'count lines
gl = 1 'group lines
Application.StatusBar = "Populating Worksheets..."
For j = 0 To i - 1
Application.StatusBar = "Writing Group " & j & " of " & i
Set objgroup = GetObject(grouppaths(j))
cl = cl + 1
groupname.Offset(, 1) = objgroup.Members.Count
c = objgroup.Members.Count
g = 0
Set objsheet = Worksheets(blad)
If objgroup.Members.Count > 0 Then
For Each objmember In objgroup.Members
g = g + 1
Application.StatusBar = "Writing Group Details " & g & " of " & c
gl = gl + 1
objsheet.Cells(gl, 1).Value = groupnames(j)
objsheet.Cells(gl, 2).Value = Right(objmember.name, Len(objmember.name) - 3)
objsheet.Cells(gl, 3).Value = objmember.OperatingSystem
objsheet.Cells(gl, 4).Value = objmember.distinguishedName
Next
Else
gl = gl + 1
objsheet.Cells(gl, 1).Value = groupnames(j)
For h = 2 To 2 'numheader2
objsheet.Cells(gl, h) = NoEntry
Next
End If
Next
|
|
|
|
|
What do you mean by "member of a group" and a "normal login". Those concepts don't have anything to do with each other.
Also, you might want to study the code you downloaded. Nobody is going to write your code for you and fix whatever is wrong or what you want in this script.
|
|
|
|
|
I have used some wrong word i guess
inside a AD group there can be another AD (sub)group
now I want to know of the "children" in a group are simply accounts or (sub)groups
example:
in a big firm there a employers with different languages (in Belgium nlb, FRb end geb)
in these 3 groups you have all workers of the firm so we've created a group with 3 subgroups and automatic into that big group that have only 3 subgroups, practicaly that group contains ±40000 accounts
Jan
|
|
|
|
|
Hey everyone I am trying to do a logon script with server 2008 to open a picture file for me in School I already have computer science classes but now I am in networking.
Const MAXIMIZE_WINDOW = 3
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "calc.exe", MAXIMIZE_WINDOW
Thats my extent of remembering wscripting haha thats is to do a simple log on script.
I need help wednesday is my final!
|
|
|
|
|
Member 12141451 wrote: I need help wednesday is my final! Then you need to explain your problem in better detail by Tuesday.
|
|
|
|
|
I have Excel 2007 installed on both my Windows 7 and Windows 8.1 computers. On Windows 7, a class library built with VS 2010, com visible, and registered for com works as expected. The class has the required interface to work with com. However, I copied the complete library project to the Windows 8.1 computer, and built the library with VS 2013. The library is properly registered and com visible and shows in the Excel VBA project as a reference. All the functionality is displayed through Excel's Object Explorer. But the VBA code fails with the line to set the object to to a new instance of the class. The error message given is that "class does not support automation or does not support expected interface". I have no idea how to fix the problem. I have tried everything I know to do without success. Here is the code snippet where the problem occurs.
1 Dim myPipe As TwoPhaseFlowCom
next line fails
2 Set myPipe = New TwoPhaseFlowCom
3 Call myPipe.NewFlow(WV, DV, VV, WL, Dl, LV, STEN, D)
I tried to register the dll built with VS 2010 on the Windows 7 machine on the Windows 8.1 machine. But all attempts to register failed.
Any suggestions on how to remedy the problem is appreciated.
Bobby
|
|
|
|
|
Are there any run-time dependencies you might have missed?
Try downloading the SysInternals Suite[^] from MS TechNet - it's free and incredibly useful for tracking down problems like this. Have a look at the Process Explorer and Process Monitor parts of the suite - doesn't take long to get up and running.
|
|
|
|
|
How do you make a shopping cart using visual basic
|
|
|
|
|
You can use the same principles you'd use doing it using C#.
Seriously, your question is far too broad - there are dozens of different ways of doing it. It's up to you to research them and choose an approach that suits your skills and needs.
|
|
|
|