Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy file from Network - Run file from Local PC 1

Status
Not open for further replies.

cretanion

Technical User
Jan 28, 2002
53
US
I have created a batch file on the network, but want users to click on the file, have it copy to their local drive(c:\temp), run the batch file, then delete the file copied file and close. To simple aye?? The file clears out some temp files on the local share C$, then goes to a folder on the local share and runs a command line executable to stop some processes running in task manager. Thanks in advance.
 
Why not have them run it from where it is on the network but clear the files out locally? That way you wont have to branch the execution and delete the local file...
 
Glad you brought that up, because that is my problem. How do you clear out the file locally and also run an executable on the local machine? thanks again
 
This is my script to run on the local machine

@ECHO OFF
ECHO.
cd c:\windows\temp
del *.* /Q
ECHO Closing Lotus Notes
ECHO Scanning Processes Running.....
TASKKILL /IM nlnotes.exe /F /T
CD C:\Program Files\Lotus\Notes
nsd -info
nsd -kill
ECHO Applying Fix
date /T
CD C:\Program Files\lotus\notes\data\
del cache.ndk
ECHO Starting Lotus Notes
cd C:\Program Files\lotus\notes\
notes.exe
ECHO Finished!! To close Window
PAUSE
CLS
EXIT
 
@ECHO OFF
ECHO.
cd "[highlight]%windir%[/highlight]\temp"
del *.* /Q
ECHO Closing Lotus Notes
ECHO Scanning Processes Running.....
TASKKILL /IM nlnotes.exe /F /T
CD [highlight]"[/highlight]C:\Program Files\Lotus\Notes[highlight]"[/highlight]
nsd -info
nsd -kill
ECHO Applying Fix
date /T
CD [highlight]"[/highlight]C:\Program Files\lotus\notes\data[highlight]"[/highlight]
del cache.ndk
ECHO Starting Lotus Notes
cd [highlight]"[/highlight]C:\Program Files\lotus\notes[highlight]"[/highlight]
notes.exe
ECHO Finished!! To close Window
PAUSE
CLS
EXIT

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
If the file runs OK on the local machine then it should work fine running it off the network.

The main thing you need to remember is that when the file is first clicked the users path will be the network drive instead of the local drive.
 
The file should run locally and not on the network share drive.

I am assuming from your response this is not the case and it will delete files from the network share instead?
 
@ECHO OFF
ECHO.
[highlight]C:[/highlight]
cd "%windir%\temp"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Does putting the C: make the batch file run locally? I don't need to lose my job today if I delete files from the network share drive.

Thanks
 
just because the file is on a remote machine does mean that it will "run" on that machine... the local CPU will still execute the file in its own contents... the remote machine is just acting like a hard drive in the sky...

I'm not doing a good job of explaining it.

Anyway to demonstrate what I'm trying to say you could put a junk README.TXT file out in both places and make a test script that just renames that file rather than deleting anything... that should show what I'm talking about in regard to the path.
 
hmm, that first sentence of my previous reply makes more sense if you replace the word "contents" with "context
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top