Solved

scripting

Posted on 2002-06-20
14
181 Views
Last Modified: 2010-04-13
Where do I go to learn about scripting? I want to automate some functions that can be done in Windows Explorer such as:
1.     change directory
2.     select all files in a directory
3.     change their attributes
4.     copy files
5.     map a network drive
6.     unmap a network drive

Thanks,
Stephen L. Showler
0
Comment
Question by:SShowler
  • 6
  • 4
  • 3
  • +1
14 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 7097000
0
 
LVL 2

Expert Comment

by:tobyk
ID: 7097591
I especially like winscriptingsolutions.com as mentioned before.

One of the columnists there has written an excellent book on Win32 scripting with Perl and has lots of free info and scripts on his site. http://www.roth.net/

Also given the usefulness of scripting and its cheap price i found it worthwhile actually spending some money and buying "Windows Admin Scripting Little Black Book"




0
 
LVL 7

Expert Comment

by:jmiller47
ID: 7097600
The MS Scripting home is msdn.microsoft.com/scripting

Although, the ones Sysexpert mentioned are all great. I use most of them all the time. He has some excellent ones there.

I will try to post a list of books that I used and still do use for all scripting such as VBScript, JScript, WSH, Shell.

I hope this helps!

0
 

Author Comment

by:SShowler
ID: 7101921
WOW! Usually when I ask for documentation, I get very little response. The person wants to solve the question directly and not try and teach you so you can think for yourself in the future.
What you have done is great. I appreciate it, but overwhelmed where to start. I assume you can do a lot in lots of areas with scripting. Where would you suggest I begin to get off of square one dealing with files as you do in Windows Explorer.
How about some snippets of code in the areas I am currently interested in. If more points are needed for this request, please make a suggestion. I have no problem with that. I would be more than appreciative if someone could review my past questions and give me some guidelines on assigning points. My past experience in dealing with free forums is that your question posted rarely gets answered; or if it does, it’s by some idiot that has nothing better to do that waste his/her time in forums. Usually the answer is bullshit. The only success I’ve had in the past is with Microsoft pay per incident. That gets fairly expensive at $195 a pop. I’ve had great success with your service. I have no problems paying for help.
Thanks,
Stephen L. Showler
0
 
LVL 7

Expert Comment

by:jmiller47
ID: 7101972
Glad to help. Would you rather that we pointed you to a specific book or website that has the specific inforamtion you are looking for and has helped us in the past or just paste the code in here for you to use?
0
 

Author Comment

by:SShowler
ID: 7101979
Could I get both?

Stephen L. Showler
0
 
LVL 7

Expert Comment

by:jmiller47
ID: 7102043
I'm sure we can arrange that :)You should have most of what you need ovver the next day or two.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 2

Expert Comment

by:tobyk
ID: 7102531
The question i have with regard to this is do you have any prefered program/language to do this with. The reason I ask is that although i wouldn't recommend it as a scripting language that is all stuff that could be done as a simple .cmd script.
0
 
LVL 7

Expert Comment

by:jmiller47
ID: 7102537
You can do this all in shell scripting. This is sometimes called batch sctipting, etc...

All the things you want accomplished can be done with Shell scripting... You don't need VBScript, JScript, etc...
0
 
LVL 7

Expert Comment

by:jmiller47
ID: 7102553
1.     change directory to tools
CD Tools

2.     select all files in a directory
3.     change their attributes to Read-only
ATTRIB -R *.* /S /D

4.     copy all files from c:\TOOLS to C:\NEW
COPY C:\TOOLS\*.* C:\NEW

5.     map a network drive
NET USE H: \\SERVER1\SHARE

6.     unmap a network drive
NET USE H: /D

If you need to know how to use a command, type the command and use the parameter /?
example: COPY /?
0
 
LVL 2

Expert Comment

by:tobyk
ID: 7102554
eg

1.     change directory

batch file or .cmd file with

cd %directoryname%

2.     select all files in a directory


3.     change their attributes

attrib %filename% or wildcard switches

4.     copy files

copy source destination

5.     map a network drive

net use drive_letter sharename
 

6.     unmap a network drive

net use drive_letter /d

still think other scripting as mentioned by the others is worth learning for admin purposes, login scripts etc
0
 
LVL 2

Expert Comment

by:tobyk
ID: 7102555
eg

1.     change directory

batch file or .cmd file with

cd %directoryname%

2.     select all files in a directory


3.     change their attributes

attrib %filename% or wildcard switches

4.     copy files

copy source destination

5.     map a network drive

net use drive_letter sharename
 

6.     unmap a network drive

net use drive_letter /d

still think other scripting as mentioned by the others is worth learning for admin purposes, login scripts etc
0
 

Author Comment

by:SShowler
ID: 7105166
OK, I think what you are telling me is that the old batch file technique is what to use. I thought maybe that had been improved through scripting. When I type help at the DOS prompt, I just see the old familiar commands.
Thanks,
Stephen L. Showler
0
 
LVL 7

Accepted Solution

by:
jmiller47 earned 100 total points
ID: 7105262
you dont have to use shell scripting. You can do this with VBScript and WSH also (among others) Shell scripting (cmd files) were mentioned earlier. Unless there is a problem with Shell scripting or limitations, it is the easiest to implement and use. VBScript is more powerful though.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now