Hi there im trying to write a simple program that will copy files accross a network from one dir to another.
It is a simple menu base program.
I am having trouble with the copy part of the program I have put my code below.
CLS
LOCATE 3, 35
PRINT "SOFTWARE COPY"
LOCATE 4, 35
PRINT "_____________"
LOCATE 10, 35
PRINT "1.SINGLE ZONE"
LOCATE 12, 35
PRINT "2.DUAL ZONE"
LOCATE 15, 35
INPUT "ENTER SELECTION (1-2):", number
SELECT CASE number
CASE 1
CLS
LOCATE 10, 35
INPUT "INPUT DRIVE LETTER:", drive$
IF drive$ = "c" THEN
SHELL "copy d:\tmp\*.* c:\tmp"
END IF
END SELECT
when I run the program it tells me that there is invalid data if there is a file in the first dir.
This is the beging of the program so it is not sorted out yet.
I also need to find some way of choosing the drive it copys to so for example the dir path would be set but i woulde enter the drive my self so it would prompt me with enter driveleter and i would hit c,d ,e or f and so on.
can any one help me with this i just need help with the copy part at the moment.
Thank You!
Help with program for a newbee!
Moderators:Administrator, Global Moderator
- frankiebaby
- Global Moderator
- Posts:95
- Joined:Tue Apr 30, 2002 1:38 am
- Location:Pennsylvania
- Contact:
Re: Help with program for a newbee!
well, i dunno about the invalid data part, but to pick the drive easily:
PRINT "PRESS THE SOURCE DRIVE LETTER : "
drive1$ = INPUT$(1)
PRINT "PRESS THE DEST. DRIVE LETTER : "
drive2$ = INPUT$(1)
SHELL "copy " + drive1$+ ":\tmp\*.* " + drive2$ + ":\tmp"
PRINT "PRESS THE SOURCE DRIVE LETTER : "
drive1$ = INPUT$(1)
PRINT "PRESS THE DEST. DRIVE LETTER : "
drive2$ = INPUT$(1)
SHELL "copy " + drive1$+ ":\tmp\*.* " + drive2$ + ":\tmp"
You may need to map the drives
If it's a W2k server then you should have no troubles with using \\ServerName\PublicServerFolderName in your shell (if you want to copy files from the server...just don't forget the 8.3 format)
If it's another client (and you have permissions to get access to the drive/folder(s)) then what may be the problem is that the drive needs to be MAPPED
(this info will vary depending on OS you're using):
Make sure the remote machine is set to share FILES first and there's a share icon on the drive/folder you are going to access.
Then on your local machine (I prefer Explorer, myself) open "MyComputer/Explorer" click TOOLS > Map Network Drive.
Select (virtual) Disk Drive letter first, then type complete network path to folder(s) Drive:
EX: Drive = W
Path = \\RemoteComputerName[\SpecificDirectory]
Click OK button
Now go to DOS prompt and switch to the DRIVE letter you just selected and run DIR to inspect and see if the connection is good.
GL
--MiggyD
If it's another client (and you have permissions to get access to the drive/folder(s)) then what may be the problem is that the drive needs to be MAPPED
(this info will vary depending on OS you're using):
Make sure the remote machine is set to share FILES first and there's a share icon on the drive/folder you are going to access.
Then on your local machine (I prefer Explorer, myself) open "MyComputer/Explorer" click TOOLS > Map Network Drive.
Select (virtual) Disk Drive letter first, then type complete network path to folder(s) Drive:
EX: Drive = W
Path = \\RemoteComputerName[\SpecificDirectory]
Click OK button
Now go to DOS prompt and switch to the DRIVE letter you just selected and run DIR to inspect and see if the connection is good.
GL
--MiggyD
Re: Help with program for a newbee!
^^yeah, what miggyD said, i'd have said it, too, but he/she got there first! :-/
I've not been a QBasic programmer since at least 2004. It was fun; I've moved on. Best of luck.