15,925,255 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Bark Ups (Top 13 by date)
Bark Ups
21-Aug-14 3:49am
View
Sergey is right. It is quiet simple to understand.
fileattribute - mean file can be opened (read) , deleted, append, executed. - gives you permission what you can do with a file.
if file can be accessed and read and user can read content (show on screen) it is also possible to copy it. Even if 'copy' option is not alloved you can still sit down and write it down or make screenshot (wich is also a copy of content). showing content on the screen is equal to copy.
Answering your question: How to make file readonly (c#)
check this out: http://msdn.microsoft.com/en-us/library/system.io.file.setattributes(v=vs.110).aspx
P.S. What exactly you are trying to achive?
Bark Ups
21-Aug-14 3:25am
View
@Joan: As far as i know, there is long history with ping command and strange behavior of it.
You said "ping returning ok" you mean you see ping replay ? if yes it is highly possible that this is not response from your target host but netgate for example. to confirm that you can try to ping any other not existing IP and see if it will give you back same status. (also tracert command is good to check). You can try to use nbtstat command to check if target host is available.
like nbtstat -a aaa.bbb.ccc.ddd - (for %errorlevel%)
or
nbtstat -a aaa.bbb.ccc.ddd | find "MAC" (for MAC adderess and %errorlevel%)
@Sergey: sometimes batch files are your only tool to automate things and yes it makes ppl insane :D but when done correctly with nice logging and backup module implemented to it with cooperation with vbs and wmic its really powerfull tool.
Bark Ups
20-Aug-14 20:59pm
View
Deleted
TotalHours is what you need
check this out http://msdn.microsoft.com/en-us/library/system.timespan.totalhours.aspx
Bark Ups
20-Aug-14 20:48pm
View
Maybe try to pass whole tab content to temporary place and print from there?
like new form with content as preview and print from there or just do it from hidden one?
or make tab area scrennshot than scroll down content and after taking all screenshots combine them to one file?
Bark Ups
20-Aug-14 19:38pm
View
HiI need to disagree with you Sergey at some point.
Batch files are quiet good (for windows) scripting environment if you know what can you do and how!
but to the point:
@Joan: 1st script will always show state marked as 'down' cause on every loop state is setup as down on the beginning. Setup state as down before ":loop" or make "exit" for state 'up' like if state==up goto :label
if it goes about 2nd script should work (tested variation of it on my pc)
---------------START---------------
@echo off
echo %errorlevel% ^<------------
ping -n 1 127.0.0.1
echo %errorlevel% ^<------------
ping -n 1 188.8.8.8
echo %errorlevel% ^<------------
if %errorlevel%==0 goto itsok
if %errorlevel%==1 goto notok
:itsok
echo it is ok
goto end
:notok
echo it is not ok
:end
pause
---------------END---------------
You can try:
-get rid off all rem comments. I had some problems with rem comments on my scripts. From time to time windows is getting crazy when see rem. don't know why.
-you can also try to save %errorlevel% in new variable (set var=%errorlevel% or setlocal var%errorlevel%)
-you can try adding "setlocal EnableDelayedExpansion"
and replace all % signs in variables with ! example %var% --> !var!
regards
Bark Ups
20-Aug-14 19:02pm
View
Hi , Maybe it is ancient but still not marked as answered. I think you misjudged me and i am preety sure that you can do better than that. Maybe finding solution and give more accurate answer for this question ? If you solution will be correct i will be the first to give you rep.
P.S. dont judge ppl so fast cause you will be judged same way.
regards
Bark Ups
20-Aug-14 17:55pm
View
Never to late for new Guys with same question and i found that this question was not marked as answered yet ;)
Bark Ups
20-Aug-14 17:55pm
View
what do you mean by "remote unlock" you mean logged user to it's desktop or what ?
regards
Bark Ups
20-Aug-14 17:54pm
View
Ok i will do that in future, thanks for a tip Nelek.
Bark Ups
20-Aug-14 17:49pm
View
Read about WMI / Powershell and remote commands
some help can be found here --> http://blog.commandlinekungfu.com/2009/05/episode-31-remote-command-execution.html
regards
Bark Ups
20-Aug-14 17:34pm
View
great link, use it tareq
Bark Ups
20-Aug-14 16:55pm
View
Agree with Nix
You need quiet vast knowledge about programming and protocols.
If you are a beginner i would like to propose something less complex. like local applications type of , calc, notepad.. than something like file and folder management application than maybe your first application that will connect to other host in local network, than maybe your first ftp server / client and so on...
If you dont know how to fly, dont try to build intergalactic spaceship... it is higly possible that you will fail and even discourage. Small steps are the best way.
and never give up if you really want to do sth.
good Luck and have fun
regards
Bark Ups
20-Aug-14 16:43pm
View
to perform any action (especially) admin permission one, you need to be recognized as admin on target machine (or be recognized as someone from group that will get access). If target host is one of the AD machine under your admin account and you will perform action from this account - yes it will work.. cause target machine will recognize you as the one that can do it.
as described in schtasks help file: "schtasks /create allows ADMIN to create scheduled tasks on local and remote systems.
regards
Show More