Question about Operating Systems

1 Answer

Need help batch script #!/bash/sh

I would like to know how to do a batch script for this please: Find all files within the /home folder {including sub- folders), delonging to a user that are not in that user's home folder. The chosen user's name is to be prompted and entered from the keyboard. The user's home folder can be retrieved from the /etc/passwd file. This is to be from the root user. can you help me?? thanks katrena

Posted by on

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points


    An expert that got 20 achievements.


    An expert that got 10 achievements.


    An expert that got 5 achievements.

  • Master
  • 2,427 Answers
Re: need help batch script #!/bash/sh

Google batch script programming to get tutioral and other info on batch scripting

all the batch needs to do id change its directory to the directory you want and then just use other commands to do what you want with the files

cd Documents and settings
cd user
cd temp
del *.*

Posted on Dec 30, 2007

Add Your Answer

0 characters

Uploading: 0%


Complete. Click "Add" to insert your video. Add


3 Points

Related Questions:

2 Answers

Can anyone explain how batch file works?

This is kind of tricky not knowing how familiar you are with the commandline, but a batch file simply contains single commands and executes them in order (usually from top to bottom). A batch file (or bash script in Linux) can be very helpful if you have to run certain commands over and over again, so you don't have to write them by hand.

An Example: You want to store your network settings in a text file.
You open the command prompt (WIN+R) and type this line:
mkdir C:\Network
Then you type this line:
ipconfig /all > C:\Network\ipconfig.txt
The first line creates a folder on your C: drive called "Network"
The second line runs the ipconfig command and saves it as a text file in that new folder.

To make a batch file, you open Notepad and insert the two lines. Then save it as "IP.bat" (make sure not to save it as "IP.bat.txt"! This is the most common mistake. If you save a file from Notepad, select "All Files" in the "Save As Type" dialog. Otherwise it will save it as a .txt file and you have to rename it later.)

Now you can double click the batch file and it runs all commands in the file.

You can also see the danger. If you run a batch file and don't know what it really does, it can destroy your whole system. So make sure you understand it and/or get it from a trustworthy source.

A nice example of how complex a batch file can be is here:

Copy the content into a text file, save it as AllHelp.bat, run it and it will create a webpage with all available DOS commands.

Hope this helps - otherwise let me know if you have specific questions.

Feb 26, 2012 | HEWLETT-PACKARD Operating Systems


How to Encode your VBS and JS files for secure website uploading

If you are still at Service Pack 2 then you can use Microsoft's own Script Encoder download it from HERE it's a command line version so after you have installed it you need to run the command prompt also make sure the Windows Scripting Host is started.


For both Visual Basic Scripts and JavaScript you will need to format the text in your script to look like this;


Replace your code goes here with your actual code when the encoder has been run then you will see that the <SCRIPT LANGUAGE= ********> will have changed to <SCRIPT LANGUAGE= ********.encode> and your code will be random characters.

The Syntax for the encoder from the command prompt is;


Recognized file extensions are .js and .vbs, which are changed to .jse and .vbe, respectively, after encoding, also these type of files can be decoded if you know what you are doing and therefore not totally hacker proof.

IF YOU HAVE SERVICE PACK 3 installed then this won't work at all so the best method is to use this VBS2EXE this is also a command prompt program you must make sure that the script that you want to convert is in the same root folder.


When finished there will be a new file about 10 times larger then the script with the EXE file extension if you try to edit it all the code appears random this is the best method for encoding your scripts

If you want to do it ALL online and feel secure then you can do both VBS (VIsual Basic Script) and (JS) JavaScript using this website below but it is limited to 10kb per file

If you create alot of batch files then I suggest that you also check out their BAT2EXE v1.5 this will convert CMD or BAT files into EXE files for web distribution you can also password protect and add a decompiler if required


on May 30, 2010 | Microsoft Windows XP Professional SP2

1 Answer

Bash codes dont work the bash codes used to add users , change user ect dont work what must i do to fix thix? i would be happy if i get asnwer soon because i realy need to make it work to study for my...

i found a tutorial to create a script to make this easier and a tutorial on bash commands
this is a sample menu
When you start the script a menu will appear like this:

### MENU ###


2. Varify Users

3. Delete Users


and now the BASH tutorial

Good luck and remember to be sudo when you do these commands


Oct 03, 2011 | Canonical Ltd. Ubuntu

2 Answers

Batch convert image files, that keeps a folder tree?

If your not using version 2.20 then upgrade because there is no limit according to the manufacturer.

Dec 14, 2009 | Microsoft Windows XP Home Edition

1 Answer

String Manipulation in Batch Script

/* REXX is better than Batch Scripting -- see */
filename = ''
char = '_'
parse var filename part1 (char) part2
first4 = left(part2,4)
say 'First 4 characters are:' first4

Aug 07, 2008 | Operating Systems

2 Answers

To make .bat file

Here is a site that has all of the information that you will need including the autorun.inf and autorun.bat. It is included in the sample and should be rather strait forward. If you need any assistance, please let me know.

Jun 14, 2008 | Microsoft Windows Vista Ultimate Edition

2 Answers

How to edit registry

1) to edit registry go to start / select run and type regedit. from there you are able to edit registry values. BEWARE because editing registry values may make your windows stop working. you should know what you are doing and you are responsible of the cosnequenses 2) a bat file is a batch file. Batch files are files that allow MS-DOS and Microsoft Windows users to create a lists of commands and/or programs to run once the batch file has been executed. 3) create a file called autorun.inf and type inside [autorun] open=file.exe save your file and write it in the cd you want to autorun the file.exe part must be replaced with the executable you want to load when your CD autoruns

Oct 08, 2007 | Microsoft Windows XP Professional With...

1 Answer

Linux scripting

Have you tried this link:

Sep 22, 2007 | Operating Systems

1 Answer

Lunix scripting

Assuming you have ALLCORES directory: su - root find /tmp -type f -name core -exec mv {} ~/ALLCORES \;

Sep 22, 2007 | Operating Systems

7 Answers

XP Themes

i wanna full version themes for my desktops

Aug 24, 2007 | Microsoft Windows XP Professional With...

Not finding what you are looking for?
Operating Systems Logo

Related Topics:

245 people viewed this question

Ask a Question

Usually answered in minutes!

Top Operating Systems Experts


Level 3 Expert

18259 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Martin Murray

Level 3 Expert

1614 Answers

Are you an Operating System Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides