Computing.Net > Forums > Programming > Batch File to Map to PC

Batch File to Map to PC

Reply to Message Icon

Original Message
Name: mentalmike
Date: March 14, 2007 at 08:07:40 Pacific
Subject: Batch File to Map to PC
OS: XP
CPU/Ram: P4, 512mb
Model/Manufacturer: HP
Comment:

Hi, having abit of trouble with making a batch file.

All I want to happen is for a prompt to come up asking for the pc name, I hit return and then it maps to it.

I can get this to work without the prompt or I can get the prompt to work without the maping! Here is my code:

@echo off
set /p path=Enter PC Path^>
if exist f: net use f: /delete
net use f: \\%path%\c$
echo %path%
echo.
pause

what am I doing wrong?
Cheers


Report Offensive Message For Removal

Response Number 1
Name: IVO
Date: March 14, 2007 at 10:59:10 Pacific
Subject: Batch File to Map to PC
Reply: (edit)

Surely to name your variable "path" as Path is the system environment variable to enumerate the folders holding the executables.

So rename path to e.g. mypath and retry.


Report Offensive Follow Up For Removal

Response Number 2
Name: mentalmike
Date: March 15, 2007 at 00:15:32 Pacific
Subject: Batch File to Map to PC
Reply: (edit)

Thanks for your help, works fine now! Knew it had to be something simple!!


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch File to Map to PC

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software