Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Change file extension, idendify user in server and root path

maleckmaleck Posts: 2Member
I would like to make a *.bat file on this and I would like any possible comment and corrections.

In order to understand what I need, the following explanation:

1-Is there a way to reduce or eliminate the flickering of the personalized screen size when it is created as shown in the code below?

2-I want to modify and improve "folder_nameA" so as it becomes a folder located in an intranet folder. What command or how is the exact code that should I use to get to the intranet root/path that I already know? ex.: "\HKLfolder1folder2folder_nameA". Note that in the code below I use the drive letter K. Most of times is letter K, but othertimes users have this folder assigned to different letters as F,G,L,U etc. It depends on how this folder is mapped for every user. Suggestions?

3-I would like a command to replace "Name_of_Windows_User" so it really identifies the actual user that is logged in

4-How can I use the command IF EXISTS in this situation? If *.avi does not exist, go to line "prog1" and warn the user

5-Is the "error level 2" an error typical to "no internet connection problem"? If not, what should I use instead as an error message when the internet cable is not connected for example?

6-Suppose I also want to create a EXE file on this little DOS program. I am an administrator of the logged in section but I am not a Windows administrator. Everytime I try to edit a cmd and run a *.bat extension that was renamed to an *.exe extension I receive the error : A CPU NTVDM has found an unauthorized instruction. CS:0fbd IP:0101 OP:65 64 68 8f 10 Choose 'close' to exit application. How can I turn this final bat program into an exe an execute? Adding to that, is there a DOS command to bypass Windows administration privilleges as to run my EXE in any computer?

Kind regards,
Maleck

@echo off
FOR /L %%W IN (1,1,18) DO MODE CON:COLS=60 LINES=%%W
cd
cd k:
cd folder_nameA
ren *.avi *.mpeg

@echo off

if errorlevel 0 goto end
if errorlevel 1 goto prog1
if errorlevel 2 goto prog2

:end
echo Dear user "Name_of_Windows_User", the conversion from AVI
echo to MPEG is successully done. Press any key to exit ....
pause >nul

:prog1
echo File AVI does not exist in selected folder "folder_nameA". Press any key to exit ....
pause >nul

:prog2
echo Net connection is not working. Please connect and run program again. Press any key to exit.
pause >nul

Sign In or Register to comment.