James121
New Member
People Are So mean
Posts: 48
|
Post by James121 on Jan 24, 2004 11:39:23 GMT -5
how to make when you open the program the exe move to a nether place i need that code
|
|
|
Post by Lazer on Jan 24, 2004 16:50:18 GMT -5
hmmm not sure what u mean ? if its what i think on the form's property scroll to the bottom and click start up possition ?
|
|
|
Post by Alexander on Jan 25, 2004 5:06:51 GMT -5
lazer i think he means he wants the exe to move itself when he presses a button to a diff location
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
Post by Tewl on Jan 25, 2004 10:30:49 GMT -5
well heres some thoughts
have the program check to see if its in the directory u want if not copy the program to a different directory an run it with the path to the currently running program as a argument and close the current program. then have the program read the arguments when it opens an if they are not null an hte path to the file exists delete it
K well i have no code for u but that should help if u have any idea how to code
|
|
Ziggy
New Member
Ziggy the Hamster since 1-6-2001
Posts: 67
|
Post by Ziggy on Feb 25, 2004 0:56:46 GMT -5
$me thinks he's making malware that copies itself to Windows startup... Call Shell("copy """ & App.Path & "\name of the exe.exe"" ""C:\where you want the file\file.exe""", 0) by the way "" means " in VB """ puts a quote and then exits the string just in case you want to remove them... P.S. You need the quotes! Windows uses long file names, and you must put them in quotes example br]THIS WORKS br]copy "C:\Documents and Settings\Keith Gable\My Documents\My Projects\Test\test.exe" "C:\Somewhere\test.exe" THIS DOESN'T br]copy C:\Documents and Settings\Keith Gable\My Documents\My Projects\Test\test.exe C:\Somewhere\test.exe since it doesn't know where the file name ends since there's spaces hope I explained it good enough
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
Post by Tewl on Feb 25, 2004 13:05:43 GMT -5
The fact that windows uses long file names isnt the reason for the quotes you need the quotes because you have to pass the fle information as a string parameter an strings are recognized in vb as having quotes
|
|
|
Post by Alexander on Feb 27, 2004 8:02:28 GMT -5
and wouldnt it be more all round better if you used...
copy app.path & "\" & "test.exe" "C:\Somewhere\test.exe"
that way no matter where the exe is it can copy itself?
|
|